macroquad icon indicating copy to clipboard operation
macroquad copied to clipboard

Add several functions to interact with animations using strings

Open DaQueenJodi opened this issue 3 years ago • 3 comments

I noticed there was a name field on the Animation struct, so I figured it would be useful to use it to set the current animation, get the name of the current animation, and be able to get the index from the name i wasn't sure what to call the functions, but hopefully these are fine.

DaQueenJodi avatar Jul 18 '22 19:07 DaQueenJodi

it may be better to take a &str for each function, which should be pretty easy to change I decided to use a String for all of them since get_current_str() would need to return a String and not a &str, but that may not be that important

DaQueenJodi avatar Jul 18 '22 19:07 DaQueenJodi

alright, just changed those 2 to take a &str

DaQueenJodi avatar Jul 18 '22 21:07 DaQueenJodi

I also just added a way to get the number of frames in the current animation, which could be useful, would you want me to commit that to the PR as well?

DaQueenJodi avatar Jul 19 '22 22:07 DaQueenJodi