Hey all, been working on getting some sort of game together, and I’ve found a few roadblocks as a corona noob I was wondering if I could pick some brains about here…
first, I coded up some nice buttons to control my character running, and jumping and was upset to find that multitouch doesn’t work on these button widgets, so if I was holding the run button down, I couldn’t jump…
So I recoded them all to use imageRect, and sprite images, and the outcome seems no different, I can’t jump if I’m running 
Also, the user can drag their finger out of the button, and they will continue to run, ie: no release is triggered if they drag out of the image area…
So… I added the “elseif event.phase == “moved” then”
but that triggers if they move their finger a little bit, not out of the image…
here is my code :
goRightButton = display.newImage( imageSheet, 7 )
goRightButton.x, goRightButton.y = 110,300
local function goRightTouched( self, event )
if event.phase == "began" then
print('goright Touched')
walkRight()
elseif event.phase == "moved" then
print('goright released')
standRight()
elseif event.phase == "ended" or event.phase == "cancelled" then
print('goright released ')
standRight()
end
return true
end
goRightButton:addEventListener( "touch", goRightButton )
jumpButton = display.newImage( imageSheet, 11 )
jumpButton.x,jumpButton.y = 440,300
local function jumpTouched( self, event )
print('Jump released ')
ninjaJump()
return true -- IMPORTANT
end
jumpButton.tap = jumpTouched
jumpButton:addEventListener( "tap", jumpButton )
basically, I’d like to user to be able to drag their finger across 2 buttons and have whichever their touch is inside be active… not as it is now, where the user must actually “press” or “release” the button…
is this possible ? it’s gotta be…
[import]uid: 157863 topic_id: 30516 reply_id: 330516[/import]