spritesheets / animation
finally … spritesheet support
spritesheets
added a new SpriteSheetComponent with:
- texture
- rows / columns
- optional row + column spacing
- start frame
- animation length
- FPS
- looping
- playing / paused state
- current frame
basically the renderer can now render only a specific UV region of a texture
animation
also added a small sprite animation system that advances frames based on FPS and handles looping / stopping at the end etc etc
animations also update while in the editor… might be annoying for some, might be less annoying for others.. but thats how i like it
editor stuff
you can pick the texture, set rows / columns and spacing, choose the start frame + animation length, change FPS, toggle looping / playback, scrub the current frame, restart the animation, etc. etc
EngineLib
scripts can inspect stuff like the current frame, frame count, FPS, rows / columns and texture, and can also change the texture/grid/animation, set frames, play, pause, restart and stop animations.
Collider also has a proper EngineLib component wrapper instead of collision only being accessible through the callback hooks. right now that’s just getting / setting whether it’s a trigger, but it’s there.
also added both Collider and SpriteSheet to the normal GetComponent, AddComponent, RemoveComponent, HasComponent, etc. obviously.
some cleanup
did a bit of registry / EngineLib locking cleanup while I was in there too, mostly around entity wrappers being created while the registry lock is already held.
also fixed one very stupid collision callback typo where on_collision_stay was looking up the wrong hook… oops…..
im also starting on documenting this stuff…. yep.. pain…
spritesheet used in video attached for testing is : https://opengameart.org/content/animated-butterfly
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.