btw pls star on girhub
animation clips / refactoring spritesheets
…kinda refactoring the whole spritesheet animation thing already
the first version worked, but having FPS / looping / frame ranges etc directly on the SpriteSheetComponent was gonna get pretty limiting cuz what if I wanted multiple animations for one sprite.
it might sound stupid but for me it’s always worked to get a prototype working, then refactor/reimplement it. thats even what i did for this entire project early on, before it deleoped into a full on engine :D
so now the spritesheet is mostly just the sheet + currently displayed frame, and animation playback is seperate
animation clips
working on proper animation sets + clips.
an animation asset can have one spritesheet and multiple named clips, with each clip containing its own list of frames :D
each frame also has its own duration now instead of the whole animation just sharing one FPS value, so stuff like holding a frame longer or doing irregular timing is possible without
clips can loop independently too
animator component
added a separate SpriteAnimatorComponent which handles the actual playback state:
- animation asset
- initial clip
- autoplay
- current clip
- current frame inside that clip
- elapsed time
- playing state
the normal SpriteSheetComponent is way simpler now…
it just says what sheet + frame should currently be rendered
(the animator updates that for it)
animation assets
animation sets are assets now under assets/animations/
they serialize separately and contain the spritesheet setup plus all the clips / frames / durations
they are loaded through the normal asset system and registered in the ResourceManager
scene serialization now keeps the animator config like the selected animation asset, initial clip, and autoplay
editor stuff
the sprite sheet inspector got reworked for the current thing but whole UI stuff isnt finished
once an animator is attached it owns the sheet/frame instead of both systems trying to edit the same thing.
I still need a proper UI for actually making / editing animation assets and clips though. i shall work on this next!!!
(right now the backend is pretty much all ive done but its taken a lil longer than i thought…
who wouldve thought adding cips cleanly would take this whole aah refactor)
scripting
EngineLib updates too
SpriteAnimator in scripts can now do:
Play("walk")Restart("walk")Pause()Resume()Stop()IsPlaying()GetClip()
it is now based on named clips
so i guess not anything flashy to show but… its stuff :)
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.