-
-
Notifications
You must be signed in to change notification settings - Fork 189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Customizable sprite loop frames #101
Comments
Hi, Thanks for your very nice comment about SGDK =) I'm glad you appreciate it ! About SPR_setAnim(..) and SPR_setAninAndFrame(..) you're right, they should set timer to 0, thanks for reporting the issue ! I can fix it to on my side :) Of course you can do a PR, i need to validate it first as t will require some changes in my library as well ! |
Hm... imo it is not flexible. |
Indeed i'm planning since some time now to update the resource file format and use something as json so we can easily set advanced properties for some resource definitions (SPRITE heavily require it) |
Hi Stephane,
I've recently discovered the SGDK and I'm really loving it.
I was doing some tests today with some shmup-like prototype when I've come across with something: The "loop" property of the SpriteDefinition is always zero, so all animations will loop back to frame 0.
The possible solution:
I've made some "homemade" changes to the Sprite plugin in the rescomp to add customizable frames to loop for each animation, with an array-like notation:
SPRITE styx_sprite "sprite/styx.png" 4 3 FAST 5 NONE [0,1,1]
The first animation will loop back at 0, while the other two will loop back to 1 (which in this case, is "no-loop"). The tests was successful.
With that in mind, I wanted to know if, after I refine the solution (which is a bit messy at the moment, hehe), I can open a PR.
Also, doing that I discovered that the
SPR_setAnim()
andSPR_setAnimAndFrame()
didn't reset the frame's timer, leading to, sometimes, the first frame being sort of skipped. I also made a fix for this if you don't mind.Thank you for listening.
And thank you very much for the SGDK! It's awesome! :3
The text was updated successfully, but these errors were encountered: