Touch event

I want to know all about the touch variable and hoe i can access it. It seems it is related to hierarchy of views and how classes are related together in the application. I hope you can help me fast. My project is due in a week and this is only the beginning of my issues.

It seems it is related to hierarchy of views and how classes are related together in the application.

No, it’s just the argument of the function touched. You can name that argument whatever you like (touch or t is usual) but you must have a touched function.

function touched(touch)

Beyond that, we can’t really help you without more info about what kind of project it is, what kind of touch events you’re registering (multitouch? Gestures like pinch to zoom? etc ) and what problems you’re having.

The multitouch example code that comes with Codea is a nice, very minimal example of multitouch, it should give you the general idea.

I always recommend the coolcodea tutorial series, there’s definitely a lot of info there about dealing with touches.

I want to use the button to pass to a second menu. In my previous trials, the touch variable was accesible but in the latest trial where i grouped all buttons in same class, i couldn’t use it. Any idea why? @yojimbo2000 . And btw thanks for your previous reply

@calinefrangieh - this may help

https://coolcodea.wordpress.com/2014/12/28/188-understanding-touch/

@ignatz this is very helpful indeed thank you. But what if i cant access the

Access what?

The variable touch or t. The variable that holds the data of the position of a touch.
When you say function xxx:touched(TOUCH). TOUCH should be defined shouldn’t it? @Ignatz

@calinefrangieh - this is how you run touched in a class

--first you must use the touched function
function touched(t) --t will have all the touch data
    xxx:touched(t) --pass it to the class
end

Thank you very muchh for your time!!