function autorepeat(theEventObj, oldX, oldY)local evtD = theEventObj or Core.class(EventDispatcher)local evt = Event.new(Event.MOUSE_DOWN)
evt.x = oldX
evt.y = oldY
evtD:dispatchEvent(evt)end
This code is for illustration, and works on the assumption that you will set the event handler and handle all Event.MOUSE_DOWN events. So you call the autorepeat as
autorepeat( theObj, xPos, yPos)
where theObj is the object that is handling the event and the position xPos, yPos is taken as the last position to give the impression that the click/tap is at the same location as the last click/tap.
If you were after something else, please re-iterate what you were after.
Comments
you can use the dispatch event
autorepeat( theObj, xPos, yPos)
where theObj is the object that is handling the event and the position xPos, yPos is taken as the last position to give the impression that the click/tap is at the same location as the last click/tap.
If you were after something else, please re-iterate what you were after.
Cheers,
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