Comments (5)
Ok, having spend even more time with animation.go I can see what you were trying to achieve there.
The main issue is with increment() method which obviously processes data.
However, I am slowly coming to some conclusions how I would like this to look like:
For me
- We should delete an actual Sprite type (legacy like you said)
- We should seriously consider renaming Region to Sprite as Region is form of a sprite. I am also fine to keep this Region if this is more natural for you. I am torn myself, as plain texture is also a kinda sprite.
- We should provide Render method for Region (Sprite) and in future Draw if the code base is refactored to use Draw everywhere. I already have it working locally - but without camera
- AnimationComponent apart from data it has (with some tweaks) should take as part of construction process - simply an array of Regions. Array is already indexed. Later through methods or constructors we can pick which indexes are part of which frames. This gives us enormous flexibility, Spriteheet is today a very specific and concrete implementation. I can imagine other implementation based on some ripped sprite sheets from the internet, which do not conform to the contract (like Hero.png example). Since AnimationComponent does not have to know much about actual concrete Spritesheet type and implementation (which assumes too many things) we can simply provide other implementations of Sprite collections, like Spritemap.
To understand me better you can have a look at spritesheet I found on the internet:
http://www.spriters-resource.com/game_boy_advance/namcomuseum/sheet/22731/
This one is far from predictable patterns despite what it seems and Spritesheet freaks out on this even with my Region various Region tweaks. With such a spritemap the only option may be to manually define Region and then form a number of array Region from them that can be animated.
Thoughts?
PS.
I miss what is this dt, which is passed in update method and also what u,v mean in Region. Help appreciated.
from engo.
@matiwinnetou IMO Region != Sprite
. A Region
represents part of a Texture
.
Yes. Regions should be Renderable
, so we can stop this kind of situation.
from engo.
Sure. Structure the AnimationComponent
however you want. As long as no logic is performed on it. Logic should be performed on the AnimationSystem
.
from engo.
dt
is delta time, the change in time since the last frame was rendered... Useful for computing movement and stuff :)
from engo.
Close please.
from engo.
Related Issues (20)
- Get Font Via URL
- Export current frame in the Animation Component
- Update isometric demo to use tiles of different sizes
- WSL to build on windows
- Shape drawing problem HOT 7
- Circle fill transparency HOT 6
- About performance HOT 7
- Scale operation seems to move the entity to the wrong position
- shader
- Support WebGL and Android HOT 11
- TMX resources cannot handle tile sets that leave a rest at end of rows HOT 2
- TMX resources don't respect transformations when loading tiles
- Build on macos M1 / Apple Silicon fails (GL/mobile-related) HOT 2
- AudioSystem's Pause and Restart aren't working
- Question: Can you draw upon a transparent window/canvas? HOT 1
- Cannot Compile on m1 mac HOT 3
- Release v1.0.7 appears to be tagged incorrectly HOT 1
- Properly handle gifs
- Add function to disable cursor HOT 1
- quadtree to fast
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from engo.