Hi,

For getting touch ‘began’, ‘moved’ & ‘ended’ in Corona, use the following code.

--Your touch event listener
 local function myTouchListener( event )
        if event.phase == "began" then
            print( "Touched!" )
        elseif event.phase == "moved" then
            print( "Touches Moved!" )
        elseif event.phase == "ended" then
            print( "Touches Ended!" )
        end
    end

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

🙂

 
 

Hi,

For getting touch ‘began’, ‘moved’ & ‘ended’ in Corona, use the following code.

--Your touch event listener
 local function myTouchListener( event )
        if event.phase == "began" then
            print( "Touched!" )
        elseif event.phase == "moved" then
            print( "Touches Moved!" )
        elseif event.phase == "ended" then
            print( "Touches Ended!" )
        end
    end

--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.