For getting touch location in Corona, use the following code,

--Your touch event listener
 local function myTouchListener( event )
        if event.phase == "began" then
        --Touch coordinates can be accessed by event.x/event.y properties of touch event
            print( "Touched!" )
            print ("Touch X = #"..event.x)
            print ("Touch Y = #"..event.y)

--Adding an event listener for touch
Runtime:addEventListener( "touch", myTouchListener )


Leave a Reply

Your email address will not be published. Required fields are marked *




Theme by HermesThemes

Copyright © 2018 CoderzHeaven. All Rights Reserved

Please wait...

Subscribe to our newsletter

Want to be notified when our article is published? Enter your email address and name below to be the first to know.