I am making a game in Corona and I want to publish it, so it needs to look good, but for some reason, when I use composer.gotoScene, my transitions don’t show up. Please Help
Here is my code
(title.lua)
local composer = require("composer")
local widget = require("widget")
local scene = composer.newScene()
local stage = display.currentStage
local function StartButtonEvent(event)
if event.phase == 'ended' then
while stage.numChildren > 0 do
local obj = stage[1]
obj:removeSelf()
obj = nil
end
composer.gotoScene("template", {effect = "fade", time = 500})
end
end
local start_btn = widget.newButton({
width = 50,
height = 25,
left = display.contentCenterX,
top = display.contentCenterY,
label = "START",
labelSize = 100,
onEvent = StartButtonEvent
})
return scene
(template.lua)
local composer = require( “composer” )
local scene = composer.newScene()
– Code outside of the scene event functions below will only be executed ONCE unless
– the scene is removed entirely (not recycled) via “composer.removeScene()”
– Scene event functions
– create()
function scene:create( event )
local sceneGroup = self.view
local ball = display.newCircle(100,100,100,100)
sceneGroup:insert(ball)
end
– show()
function scene:show( event )
local sceneGroup = self.view
local phase = event.phase
if ( phase == "will" ) then
elseif ( phase == "did" ) then
-- Code here runs when the scene is entirely on screen
end
end
– hide()
function scene:hide( event )
local sceneGroup = self.view
local phase = event.phase
if ( phase == "will" ) then
-- Code here runs when the scene is on screen (but is about to go off screen)
elseif ( phase == "did" ) then
-- Code here runs immediately after the scene goes entirely off screen
end
end
– destroy()
function scene:destroy( event )
local sceneGroup = self.view
-- Code here runs prior to the removal of scene's view
end
– Scene event function listeners
scene:addEventListener( “create”, scene )
scene:addEventListener( “show”, scene )
scene:addEventListener( “hide”, scene )
scene:addEventListener( “destroy”, scene )
return scene
Thank you in advance!