Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Remove previous scene — Gideros Forum

Remove previous scene

MastoschMastosch Member
edited February 2013 in General questions
Hy,
I'm using scene manager to manage my scenes, the problem is with removing previous scene.
I read it should be removed automatically if it's in scope.

If no, what would be best way removing AceSlide.
level = gideros.class(Sprite)
 
function level:init()
AceSlide.init({
    orientation = 'vertical',
    spacing = 10,
    parent = stage,
    speed = 5,
    unfocusedAlpha = 0.75,
    easing = nil,
    allowDrag = true,
    dragOffset = 10
})
--create 10 boxes
local yPos = 0
for i = 1, 10 do
 
	box = Button.new(Bitmap.new(Texture.new("files/test.png")), Bitmap.new(Texture.new("files/test.png")))
	box:addEventListener("click", function(e)
		local target = e.__target
		print(target.id)
		e:stopPropagation()
		sceneManager:changeScene("game", 1, SceneManager.moveFromLeft, easing.outBack)
			end)
		levelText = TextField.new(font, "Level: " .. i)
		box:setPosition(100, yPos)
	box.id = i
    AceSlide.add(box)
 
end
--display slider
AceSlide.show()
 
	self:addEventListener("enterBegin", self.onTransitionInBegin, self)
	self:addEventListener("enterEnd", self.onTransitionInEnd, self)
	self:addEventListener("exitBegin", self.onTransitionOutBegin, self)
	self:addEventListener("exitEnd", self.onTransitionOutEnd, self)
end

Comments

Sign In or Register to comment.