Hi,
Can anyone help me because the title says it all! I want to be able to have a screen change within one of my screens. I don’t want the screen to change back to the screen it came from but to another screen. THANKS! This down here is a screen itself coming from a previous screen.
[lua] module(…, package.seeall)
function new()
local localGroup = display.newGroup()
local bg = display.newImageRect(“hello.png”,_W , _H)
bg:setReferencePoint(display.CenterReferencePoint)–may need “;”
bg.x = _W/2; bg.y = _H/2
local next_btn = display.newImageRect(“back-btn.png”,32 ,32 )
next_btn:setReferencePoint(display.CenterReferencePoint)–may need “;”
next_btn.x = 290; next_btn.y = _H/1.06
next_btn.scene = “menu”
local hi_btn = display.newImageRect(“hi-btn.png”,90 ,30 )
hi_btn:setReferencePoint(display.CenterReferencePoint)–may need “;”
hi_btn.x = _W/5; hi_btn.y = _H/5
hi_btn.scene = “game”
function changeScene(e)
if(e.phase == “ended”) then
director:changeScene(e.target.scene, “flip”)
end
end
localGroup:insert(bg)
localGroup:insert(next_btn)
localGroup:insert(hi_btn)
– Listeners
next_btn:addEventListener(“touch”, changeScene)
hi_btn:addEventListener(“touch”, changeScene)
return localGroup
end
[import]uid: 81317 topic_id: 13640 reply_id: 313640[/import]