I’d like to introduce a simple way to handle multitouch in gideros with some common UI items such as button, checkbox, radio button; and some utility functions such as drag-measuring and zoom-gesture.
http://www.guava7.com/2012/gideros-multitouch-ui/Document will be added here soon!
Comments
main.lua part:
------------
Other question, are x0 and y0 standard properties of a Sprite object? Is is documented somewhere?
Thanks,
Marc
x0 and y0 are not internal properties of Sprite object. In your code you set them up manually, just to save the previous position is dragging.
What you miss actually is getting id of touch, which is event.touch.id. You need to save it on touch start, and then on touch move and touch end check if id is the same, something like that:
And don't merge touch and mouse events altogether, it could give confusing results. use one or another.
Regards,
Marc
In the CButton.lua file references are made to CSprite which is not included in the files, changing the code to Sprite works fine though.
CButton.lua:65: attempt to call method 'AddChild' (a nil value) is thrown due to a typo AddChild instead of addChild--or this could be a custom function for the CSprite class but I have no way of knowing
Anyway changing the function to addChild works with the CSprite to Sprite changes. Very neat demo. Thanks for sharing.
from the touchexplorer sample project with Gideros Studio
and here:
http://www.giderosmobile.com/documentation/events.htm
Please update lasted version in github regularly
I still don't get it work on the iPhone. In the main, I will create 6 blocks on the screen. I've created a separate block class. When I touch the screen anywhere I will move all the 6 blocks (I don't even have to touch a block). I like to move the blocks separately to different positions. Here are some code fragments:
Marc
Likes: Yan