If I press a button and then move my finger outside the button before I release, it is recognising it as a button click still. Is it possible to prevent this so that it only recognises it as a button click if the finger is released over the button?
Here is my button code which I have been using. I can’t recall where I found this code
local resetButton = ui.newButton{
default = "images/reset.png",
over = "images/resetHi.png",
onPress = button1Press,
onRelease = button1Release,
text = "",
emboss = true
}
resetButton.x = 160; resetButton.y = 276
local function clickResetButton ( event )
if event.phase == "ended" then
saveBestScore(0)
setBestScore(0)
updateOptionsHighscoreDisplay()
end
end
resetButton:addEventListener("touch",clickResetButton)
Thanks
Paul [import]uid: 7863 topic_id: 4338 reply_id: 304338[/import]