How do I make my sprite move left / right depending on the button pressed? I tried to deal with the "onMouseDown" and etc., but did not understand how it works, in particular self and event
@oiky, what do you mean when you say tried to deal with the onMouseDown ? What framework have you been using or are familiar with?
In Gideros you need to addEventListener on the object you want. You need to capture the Event.MOUSE_UP, Event.MOUSE_DOWN events as required, setting handlers for these events.
Have a look at the Button example in the Gideros Examples Directory for code.
Comments
In Gideros you need to addEventListener on the object you want. You need to capture the Event.MOUSE_UP, Event.MOUSE_DOWN events as required, setting handlers for these events.
Have a look at the Button example in the Gideros Examples Directory for code.
Likes: oiky
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps