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]