The phase == “ended” in button onEvent handler contains code to enlarge the button clicked. But the code doesn’t work unless the mouse pointer goes off screen (and back) before clicking. On an ipad, there’s no mouse so the enlarge code never works. What focus or other thing can be done to fix this ?
local function HandleRightButtonEvent( event )
if (event.phase == “began”) then
bossTrigger = false
end
if (event.phase == “ended” ) then
rightButton:setEnabled( false )
wrongButton1:setEnabled( false )
wrongButton2:setEnabled( false )
wrongButton3:setEnabled( false )
– <code that enlarges the button>
event.target.width = event.target.width*1.2
event.target.height = event.target.height*1.2
– </code that enlarges the button>
ws_question = ws_question + 1
rightIcon.isVisible = true
bonus = true
ws_score = ws_score + ws_level
end
rightButton = widget.newButton{
id = “rightButton”,
width = 96,
height = 96,
defaultFile = flagLoc … country[1],
label = “”,
onEvent = HandleRightButtonEvent
}
rightButton.x = display.contentWidth*positionArray[1]/5
rightButton.y = display.contentHeight*2/3