Creating Intro Screen and main menu in storyboard

Im trying to create a intro screen and main menu screen for my game in storyboard.

how would i go about displaying a intro screen in intro.lua and then the company logo in title.lua without them both overlapping ? as i do this they both appear.

is there a way to place code to wait 3 seconds before going to

storyboard.gotoScene( “title”, “zoomOutInFade”, 500 )

here is the code below for both my intro and title screen

intro.lua

---------------------------------------------------------------------------------  
-- Intro Screen   
---------------------------------------------------------------------------------  
local storyboard = require( "storyboard" )  
local scene = storyboard.newScene()  
---------------------------------------------------------------------------------  
-- BEGINNING OF YOUR IMPLEMENTATION  
---------------------------------------------------------------------------------  
local background  
  
storyboard.gotoScene( "title", "zoomOutInFade", 500 )  
  
-- Called when the scene's view does not exist:  
function scene:createScene( event )  
 local screenGroup = self.view  
  
 background = display.newImage( "assets/graphics/intro.png", 0, 0 )  
 screenGroup:insert( background )  
  
 print( "\n1: createScene event")  
end  
-- Called immediately after scene has moved onscreen:  
function scene:enterScene( event )  
 local group = self.view   
 print( "1: enterScene event" )  
  
 local lastScene = storyboard.getPrevious()  
  
 print( "last scene was:", lastScene ) -- output: last scene name  
end  
  
-- Called when scene is about to move offscreen:  
function scene:exitScene( event )  
 local group = self.view   
 print( "1: exitScene event" )  
end  
-- Called prior to the removal of scene's "view" (display group)  
function scene:destroyScene( event )  
 local group = self.view  
 print( "((destroying scene 1's view))" )  
end  
  
---------------------------------------------------------------------------------  
-- END OF YOUR IMPLEMENTATION  
---------------------------------------------------------------------------------  
  
-- "createScene" event is dispatched if scene's view does not exist  
scene:addEventListener( "createScene", scene )  
  
-- "enterScene" event is dispatched whenever scene transition has finished  
scene:addEventListener( "enterScene", scene )  
  
-- "exitScene" event is dispatched before next scene's transition begins  
scene:addEventListener( "exitScene", scene )  
  
-- "destroyScene" event is dispatched before view is unloaded, which can be  
-- automatically unloaded in low memory situations, or explicitly via a call to  
-- storyboard.purgeScene() or storyboard.removeScene().  
scene:addEventListener( "destroyScene", scene )  
  
---------------------------------------------------------------------------------  
  
return scene  

title.lua

---------------------------------------------------------------------------------  
-- Title Screen   
---------------------------------------------------------------------------------  
local storyboard = require( "storyboard" )  
local scene = storyboard.newScene()  
---------------------------------------------------------------------------------  
-- BEGINNING OF YOUR IMPLEMENTATION  
---------------------------------------------------------------------------------  
local background  
  
storyboard.gotoScene( "mainmenu", "fade", 1500 )  
  
-- Called when the scene's view does not exist:  
function scene:createScene( event )  
 local screenGroup = self.view  
  
 background = display.newImage( "assets/graphics/title.png", 0, 0 )  
 screenGroup:insert( background )  
  
 print( "\n1: createScene event")  
end  
-- Called immediately after scene has moved onscreen:  
function scene:enterScene( event )  
 local group = self.view   
 print( "1: enterScene event" )  
  
 local lastScene = storyboard.getPrevious()  
  
 print( "last scene was:", lastScene ) -- output: last scene name  
end  
  
-- Called when scene is about to move offscreen:  
function scene:exitScene( event )  
 local group = self.view   
 print( "1: exitScene event" )  
end  
-- Called prior to the removal of scene's "view" (display group)  
function scene:destroyScene( event )  
 local group = self.view  
 print( "((destroying scene 1's view))" )  
end  
  
---------------------------------------------------------------------------------  
-- END OF YOUR IMPLEMENTATION  
---------------------------------------------------------------------------------  
  
-- "createScene" event is dispatched if scene's view does not exist  
scene:addEventListener( "createScene", scene )  
  
-- "enterScene" event is dispatched whenever scene transition has finished  
scene:addEventListener( "enterScene", scene )  
  
-- "exitScene" event is dispatched before next scene's transition begins  
scene:addEventListener( "exitScene", scene )  
  
-- "destroyScene" event is dispatched before view is unloaded, which can be  
-- automatically unloaded in low memory situations, or explicitly via a call to  
-- storyboard.purgeScene() or storyboard.removeScene().  
scene:addEventListener( "destroyScene", scene )  
  
---------------------------------------------------------------------------------  
  
return scene  

here is the layout

Intro screen (displays company logo)
Title Menu (displays game logo)
Main Menu (main menu has Start Game, options, help,credits)
gameslot (select a save slot to play)
and
gamestart (this is the old main.lua)
[import]uid: 17701 topic_id: 26161 reply_id: 326161[/import]

You’re making a few mistakes here.

  1. To call something on a delay, you need to use a timer. ie:

[code]local function gotoCoffeeShop()
storyboard.gotoScene( “coffeeshop”, “fade”, 500 )
end

– To wait 3 seconds before switching scenes,
timer.performWithDelay(3000, gotoCoffeeShop)[/code]

  1. You shouldn’t be calling gotoScene at the beginning of your scene file! All actions should be inside one of the storyboard groups.

createScene: Occurs when the lua file first appears onscreen!
enterScene: Just after createscene, say maybe you come back to the scene later. Every time you come back this fires.
exitScene: whenever you leave for another scene
destroyScene: when the scene has to be deleted for some reason

So take that gotoscene out of the beginning of your file and only place it in createScene or enterScene (probably createScene in your case) [import]uid: 41884 topic_id: 26161 reply_id: 105952[/import]

richard9,

thanks so much for the clarification. it really helped me out.

just spent the past 3 hours coding.

i moved the code to createScene as you advised. thanks :slight_smile: [import]uid: 17701 topic_id: 26161 reply_id: 106007[/import]