Scenes overlapping

Hi guys,

So I started developing on Corona a few days ago and I’m struggling on a problem with the composer Api.

The context is: I have 1 screen with 2 buttons that will lead to different scenes. Whenever I click at any of these buttons the next scene is rendered on top of the current scene. No transition animation, nothing.

Any ideas?

-- Button1 listener function lstnrBtnFem ( event ) local options = { effect = "fade", time = 400, params = { sampleVar1 = "my sample variable", sampleVar2 = "another sample variable" } } composer.gotoScene("scene1", options) end -- Button1 listener function lstnrBtnMasc ( event ) local options = { effect = "fade", time = 400, params = { sampleVar1 = "my sample variable", sampleVar2 = "another sample variable" } } composer.gotoScene("scene2", options) end -- "scene:create()" function scene:create( event ) local sceneGroup = self.view grpOptions = display.newGroup() -- Initialize the scene here. -- Example: add display objects to "sceneGroup", add touch listeners, etc. local optsBtnFem = { label = "F", labelAlign = "center", shape = "rect", fillColor = {default = {1, 0.2, 0.5, 0.7}, over = {1, 0.2, 0.5, 1} }, strokeColor = { default={ 0, 0, 0 }, over={ 0.4, 0.1, 0.2 } }, strokeWidth = 2 , width = C\_btnWidth, height = C\_btnHeight, top = display.contentHeight/2 - C\_btnHeight, left = C\_bntMargin, onEvent = lstnrBtnFem } btnFem = widget.newButton(optsBtnFem) local optsBtnMasc = { label = "M", labelAlign = "center", shape = "rect", fillColor = {default = {1, 0.2, 0.5, 0.7}, over = {1, 0.2, 0.5, 1} }, strokeColor = { default={ 0, 0, 0 }, over={ 0.4, 0.1, 0.2 } }, strokeWidth = 2 , width = C\_btnWidth, height = C\_btnHeight, top = display.contentHeight/2, left = C\_bntMargin, onEvent = lstnrBtnMasc } btnMasc = widget.newButton(optsBtnMasc) local optsChkLembrar = { top = display.contentHeight/2 + C\_btnHeight+20, left = C\_bntMargin, style = "onOff", id = "lembrarEscolha" } chkLembrar = widget.newSwitch(optsChkLembrar) local optsLblLembrar = { text = "Remember my choice", x = chkLembrar.x + chkLembrar.width - 10, y = chkLembrar.y -8, font = native.systemFontBold, fontSize = 15 } lblLembrar = display.newText(optsLblLembrar) lblLembrar.anchorY = 0 lblLembrar.anchorX = 0 grpOptions:insert(btnFem) grpOptions:insert(btnMasc) grpOptions:insert(chkLembrar) end

You never put your object’s into the scene’s view group.  You create your own group and put things in it, but you never put that group in the scene

sceneGroup:insert( grpOptions )

should take care of it.

Rob

Thanks!!!

You never put your object’s into the scene’s view group.  You create your own group and put things in it, but you never put that group in the scene

sceneGroup:insert( grpOptions )

should take care of it.

Rob

Thanks!!!