Hey there! Congratulations on the awesome app!
I saw in the other thread that lots of people were asking for touch events. I mocked up some code that simulates this, and thought you may be interested. I’m not working on an accelerometer based game right now, so I haven’t bought the Remote, but let me tell you if it fired off tap events I’d be all over it!
Basically all my code does is loop through every display object, checks if the faked touch x and y fall within its bounds, and if they do fire off an event from that object. There’s no Runtime dispatches or listeners at all, and it my testing I’m firing the event based off a timer.
[lua]local fakedTap = function(target, eX, eY)
local properties = {
phase = “ended”,
y = eY,
yStart = eY,
name = “touch”,
x = eX,
target = target,
time = system.getTimer(),
id = nil,
xStart = eX
}
target:dispatchEvent(properties)
end[/lua]
Once you find out which object was touched, pass it and it’s event.x and event.y to the above method and the listener will receive and react. I know all the looping will hurt performance, but hey this is a dev tool, and you’re getting events from your device! In my mind it’s worth any performance hit as long as it’s functional. I’m sure you could come up with a more efficient way of doing it anyway.
Hope to see touch (or tap! I’d take either!) in a looming update! [import]uid: 12405 topic_id: 5300 reply_id: 305300[/import]