The coding that I’m using for the storyboard isn’t right, because it doesn’t show my app in the simulator.
Can you help me to correct my mistakes?!
main.lua
[code]display.setStatusBar( display.HiddenStatusBar )
local storyboard = require “storyboard”
storyboard.gotoScene( “menu” )[/code]
menu.lua
[code]local storyboard = require “storyboard”
local scene = storyboard.newScene()
local widget = require “widget”
display.setStatusBar( display.HiddenStatusBar )
local button, button2, button3, button4, button5, background, ball, white, myText, myText2
local function onButtonRelease( self, event )
if event.phase == “release” then
storyboard.gotoScene( “sp” )
return true
end
end
local function onButtonRelease2( self, event )
if event.phase == “release” then
storyboard.gotoScene( “mp” )
return true
end
end
local function onButtonRelease3( self, event )
if event.phase == “release” then
storyboard.gotoScene( “pm” )
return true
end
end
local function onButtonRelease4( self, event )
if event.phase == “release” then
storyboard.gotoScene( “tbm” )
return true
end
end
local function onButtonRelease5( self, event )
if event.phase == “release” then
storyboard.gotoScene( “s” )
return true
end
end
function scene:createScene( event )
local screenGroup = self.view
background = display.newImage ( “SkySoccer Grass.jpg” )
ball = display.newImage( “SkySoccer Ball.gif” )
ball.x = display.contentWidth / 2
screenGroup:insert( ball )
white = display.newImage( “witteachtergrond.png” )
white.x = display.contentWidth / 1.3
white.y = display.contentWidth / 25
screenGroup:insert( white )
myText = display.newText( “SkySoccer”, 0, 0, native.systemFont, 50 )
myText.x = display.contentCenterX
myText.y = display.contentWidth / 4.5
myText:setTextColor( 255, 0, 0 )
screenGroup:insert( myText )
myText2 = display.newText( “BroekieNetwork”, 0, 0, native.systemFont, 20 )
myText2.x = display.contentWidth / 1.3
myText2.y = display.contentWidth / 25
myText2:setTextColor( 0, 0, 255 )
screenGroup:insert( myText2 )
button = widget.newButton{
id = “singleplayer”,
left = 100,
top = 150,
default = “single player.png”,
over = “single player2.png”,
onEvent = onButtonRelease
}
screenGroup:insert( button )
button2 = widget.newButton{
id = “multiplayer”,
left = 100,
top = 150,
default = “multiplayer.png”,
over = “multiplayer2.png”,
onEvent = onButtonRelease2
}
screenGroup:insert( button2 )
button3 = widget.newButton{
id = “promode”,
left = 100,
top = 150,
default = “pro mode.png”,
over = “pro mode2.png”,
onEvent = onButtonRelease3
}
screenGroup:insert( button3 )
button4 = widget.newButton{
id = “twoballsmode”,
left = 100,
top = 150,
default = “two balls mode.png”,
over = “two balls mode2.png”,
onEvent = onButtonRelease4
}
screenGroup:insert( button4 )
button5 = widget.newButton{
id = “shop”,
left = 100,
top = 150,
default = “shop.png”,
over = “shop2.png”,
onEvent = onButtonRelease5
}
screenGroup:insert( button5 )
end
scene:addEventListener( “createScene”, scene )
return scene[/code]
sp.lua
[code]local storyboard = require “storyboard”
local scene = storyboard.newScene()
local widget = require “widget”
display.setStatusBar( display.HiddenStatusBar )
local background = display.newImage ( “uitlegbg.jpg” )
local myText = display.newText( “Single Player”, 0, 0, native.systemFont, 40 )
myText.x = display.contentCenterX
myText.y = display.contentWidth / 10
myText:setTextColor( 255, 0, 0 )
local myText = display.newRetinaText( “You have one ball and you have to keep the ball high as many times as you can”, 30, 70, 280, 220, native.systemFont, 22 )
myText:setTextColor( 255, 0, 0 )
local road = display.newImage( “roadklein.jpg” )
road.x = display.contentWidth / 5.5
road.y = display.contentWidth / 1.5
local beach = display.newImage( “beachklein.jpg” )
beach.x = display.contentWidth / 1.97
beach.y = display.contentWidth / 1.5
local house = display.newImage( “houseklein.jpg” )
house.x = display.contentWidth / 1.2
house.y = display.contentWidth / 1.5
local park = display.newImage( “parkklein.jpg” )
park.x = display.contentWidth / 3.3
park.y = display.contentWidth / 0.95
local stadium = display.newImage( “stadiumklein.jpg” )
stadium.x = display.contentWidth / 1.4
stadium.y = display.contentWidth / 0.95
local function goBack( event )
if event.phase == “release” then
storyboard.gotoScene(storyboard.getPrevious())
end
return true
end
local myButton = widget.newButton{
id = “btn001”,
left = 100,
top = 200,
default = “back.png”,
over = “back2.png”,
onEvent = goBack
}
group:insert( myButton )
local function Start( event )
if event.phase == “release” then
storyboard.gotoScene(“spstart”)
end
return true
end
local myButton2 = widget.newButton{
id = “btn002”,
left = 150,
top = 250,
default = “start.png”,
over = “start2.png”,
onEvent = Start
}
group:insert( myButton2 )[/code] [import]uid: 203192 topic_id: 34070 reply_id: 334070[/import]