turn a sprite sheet animation into a button

I’ve looked all over and this seems like it should be simple but I can’t figure it out. I want to turn a sprite sheet animation into a button so when the animation is pressed I can add a down state and then have something else happen. Is there a pressed state for the spriteInstance listener? [import]uid: 27060 topic_id: 11243 reply_id: 311243[/import]

When you say a “down state”, do you mean in the same way that a ui button has onRelease or the like?

If you’re only adding a listener is there any reason not to do it in the standard mysprite:addEventListener(“tap”, myfunction) way? Are you wanting it to change appearance when touch is down?

Peach :slight_smile: [import]uid: 52491 topic_id: 11243 reply_id: 40791[/import]

I’m not sure if that’s what you need but take a look at my enhanced ui.lua @ code exchange.

http://developer.anscamobile.com/code/enhanced-ui-library-uilua

You can use sprite images for default & over states. I did’t try it with animated sprites but it should work. [import]uid: 10478 topic_id: 11243 reply_id: 40799[/import]