Hi all!
I'm having a issue with the Gideros Scene Manager.
Everytime I click the button that has the listener for changing scenes, it doesn't use the transition that I put down, it just transitions regulary.
Here are my files:
main.lua
sceneManager = SceneManager.new({
["loadmain"] = loadmain,
["login"] = login,
["mainmenu"] = mainmenu,
["createEvent"] = createEvent,
["Party"] = Party,
["Vacation"] = Vacation,
["Other"] = Other,
["ViewEdit"] = ViewEdit,
["Settings"] = Settings,
["Help"] = Help,
["FAQ"] = FAQ,
["About"] = About,
})
stage:addChild(sceneManager)
sceneManager:changeScene("mainmenu") |
mainmenu.lua
mainmenu = gideros.class(Sprite)
function mainmenu:init()
--Background Image
local background = Bitmap.new(Texture.new("Images/test.png"))
stage:addChild(background)
--Create Event Button
local createBtn = Bitmap.new(Texture.new("Images/btn1.png"))
local createBtn_over = Bitmap.new(Texture.new("Images/btn1_over.png"))
--The Actual Button and Listener
local button1 = Button.new(createBtn, createBtn_over)
button1:addEventListener("click",
function()
sceneManager:changeScene("createEvent", 1, SceneManager.flipWithFade)
end)
--Add Button To Scene
button1:setPosition(70, 200)
stage:addChild(button1)
-------------------------------------------------------------------------------
--Create Event Button
local viewBtn = Bitmap.new(Texture.new("Images/btn2.png"))
local viewBtn_over = Bitmap.new(Texture.new("Images/btn2_over.png"))
--The Actual Button and Listener
local button2 = Button.new(viewBtn, viewBtn_over)
button1:addEventListener("click",
function()
sceneManager:changeScene("ViewEdit")
end)
--Add Button To Scene
button2:setPosition(70, 450)
stage:addChild(button2)
-------------------------------------------------------------------------------
--Create Event Button
local settingsBtn = Bitmap.new(Texture.new("Images/btn3.png"))
local settingsBtn_over = Bitmap.new(Texture.new("Images/btn3_over.png"))
--The Actual Button and Listener
local button3 = Button.new(settingsBtn, settingsBtn_over)
button1:addEventListener("click",
function()
sceneManager:changeScene("Settings")
end)
--Add Button To Scene
button3:setPosition(70, 700)
stage:addChild(button3)
-------------------------------------------------------------------------------
end |
createEvent.lua
createEvent = gideros.class(Sprite)
function createEvent:init()
--Background Image
local background = Bitmap.new(Texture.new("Images/test.png"))
stage:addChild(background)
end |
I really need help with this, or my app won't work
Thanks in Advance!
-Landon
Comments
(in mainmenu.lua)
You are defining local button1 then defining an event listener to it,
after you are defining local button2 but the event listener is again registered to button1 withouth any transition effect and the same goes for button3 also.
So just edit the eventlisteners to corresponding buttons and all will be ok i guess.