-- Option Screen
-- OptionScreen.lua (loads a bunch of things)
module(..., package.seeall)
function new ()
print("OptionScreen new()")
-- Set up graphics
local screen = display.newGroup()
local base = display.newImage("embed/titleBG.jpg")
screen:insert(base, false)
base.x = 240
base.y = 160
local backButton = display.newImage("embed/iconBack.png")
screen:insert(backButton, true)
local onBack = function( event )
print("OptionScreen onBack()")
screen:hide()
local function listener( event )
screenManager.showOnly( "TitleScreen" )
end
return true
end
-- Protected need override
local function setupEvents()
print("OptionScreen setupEvents()")
backButton:addEventListener( "tap", onBack )
end
-- Common functions
function screen:start()
setupEvents()
end
-- Return instance of anim
return screen
end
This lua file is required in the main and new() is called. start() function is also called.
However, the tap event on the iconBack.png simply refuses to get registered. I am not sure what I am doing that is wrong.
I have tried making the onBack into a global type (function backButton:touch(event) … )
.
Has anyone experienced similar issues.
I have tested this with Horizontal/Vertical orientation, putting iconBack.png into part of screen group and not, nothing seem to work.
UPDATE
Tested a bit more… .realised that this is again the Orientation related problem. In landscape mode, the touch event coordinates are weird.
[import]uid: 6066 topic_id: 1043 reply_id: 301043[/import]