kaplay icon indicating copy to clipboard operation
kaplay copied to clipboard

feat: fallback animation for sprites

Open candycarmel opened this issue 1 year ago • 1 comments

sort of related to a problem, more a helpful feature

constantly checking if the current animation is null before checking what the current animations name is is kind of tiresome

I'd like a fallback animation option for sprites

You should be able to provide the name of the fallback animation in the anims opt

I have a small code snippet in update that checks if the animation is null and then changes it to the fallback animation instead.

i dont think any other context should be needed

:)

candycarmel avatar Jul 14 '24 02:07 candycarmel

You could use obj.getCurAnim()?.name, that way you don't need to test for null.

mflerackers avatar Aug 26 '24 01:08 mflerackers