How i can make an active pause image?
I’ve added the image in the game, but the big question is how to make it active, when it’s clicked to pause the game.
I’ve added this in the code, but im not sure is it correct:
pause.id = “pause”
local function onObjectTouch( event )
if ( event.phase == “began” ) then
print( "Touch event began on: " … event.target.id )
elseif ( event.phase == “ended” ) then
print( "Touch event ended on: " … event.target.id )
end
return true
end
object:addEventListener( “touch”, onObjectTouch )
^^With this now, when i click it print text. But how to make it to stop the game?