Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat | DONATE
SceneManager issues — Gideros Forum

SceneManager issues

andybarillaandybarilla Member
edited March 2012 in General questions
I've been trying to use the SceneManager to fade between two scenes. Unfortunately it's not working and I'm sure I'm missing something obvious.

---main.lua---
application:setOrientation(Application.LANDSCAPE_LEFT)
 
sceneManager = SceneManager.new({
	["splash"] = splash,
	["game"] = game
})
 
stage:addChild(sceneManager)
sceneManager:changeScene("splash")
---splash.lua---
splash = gideros.class(Sprite)
 
function splash:init()
	stage:addChild(Bitmap.new(Texture.new("images/logoSplash.png")))
 
	local timer = Timer.new(2000, 1)
	timer:addEventListener(Event.TIMER_COMPLETE, 
		function()
			sceneManager:changeScene("game", 1, SceneManager.fade, easing.linear)
		end
	)
	timer:start()
end
---game.lua---
game = gideros.class(Sprite)
 
function game:init()
	stage:addChild(Bitmap.new(Texture.new("images/gameBackground.png")))
end
Tagged:

Comments

Sign In or Register to comment.