1) are you testing on device or Desktop? If on device, then did you enable in project properties (right click on project name in Gideros Studio, properties, and Input tab )for touch events to generate mouse events? 2) is your mysprite added to stage hiearchy?, if should be, or else it won't receive the event.
it's a simple code: stage:addChild(mysprite) function onMouseDown(event) print(event.x, event.y) end mysprite:addEventListener(Event.MOUSE_DOWN, onMouseDown)
Comments
2) is your mysprite added to stage hiearchy?, if should be, or else it won't receive the event.
Likes: Hanigran
Likes: Hanigran
stack traceback:
Projekt.lua:1: in main chunk
can you post the full code?
Likes: Hanigran
stage:addChild(mysprite)
function onMouseDown(event)
print(event.x, event.y)
end
mysprite:addEventListener(Event.MOUSE_DOWN, onMouseDown)
what is mysprite? you need to create an object that is referenced by the mysprite variable.
so you might need something like
Likes: Hanigran
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