Hello,
How do I add addEventListener for touch on object using script?
as we have mouchdoun event like
runtime.addEventListener("mousedown",(e)=> alert(JSON.stringify(e)))
but for touch on specific object how can i impalement
thanks in advance
Hi sejal you might get a better response from the scripting forum construct.net/en/forum/construct-3/scripting-51
Moved to scripting forum.
To detect a touch/click on an object, use the normal "mousedown" or "pointerdown" event, convert the touch position to layer co-ordinates with cssPxToLayer, and then use containsPoint method to check if that point overlaps an instance.
Develop games in your browser. Powerful, performant & highly capable.
thank you for reply..it's work and helpful
construct.net/en/forum/construct-3/scripting-51/handle-clicks-object-js-154194
this is with example of my problem