Once I create a new scene IE. level1world1 does storyboard still store my other scenes? The reason I ask is because in my level1world1.lua I’ve created a “Home” button which I’m calling the splashscreen.lua with but when I click it nothing happens.
Heres my code for the button:
local homebutton = display.newImage( "homebutton.png" )
group:insert(homebutton)
homebutton.x = display.contentWidth / 1.69
homebutton.y = display.contentHeight / 13.2
local function homebuttontouched (event)
if ("ended" == event.phase) then
storyboard:gotoScene( "splashscreen", "fade" )
end
end
homebutton.active = true
local function homebuttontouched(e) if e.phase == "began" then
e.target.alpha = .5
end if e.phase == "ended" then
e.target.alpha = 1 print("Home button was touched.")
end
end
homebutton:addEventListener( "touch", homebuttontouched )
homebutton:addEventListener('tap', homebutton)
--end home button
This is at the top of my .lua
local storyboard = require( "storyboard" )
local scene = storyboard.newScene()
function scene:createScene( event )
local group = self.view
and this is at the bottom
end
function scene:enterScene( event )
local group = self.view
end
function scene:exitScene( event )
local group = self.view
end
function scene:destroyScene( event )
local group = self.view
end
scene:addEventListener( "createScene", scene )
scene:addEventListener( "enterScene", scene )
scene:addEventListener( "exitScene", scene )
scene:addEventListener( "destroyScene", scene )
return scene
when I switch scenes from my splash screen (options/about section) and I click on an identical button to go back to the splash screen it works fine. just a bit confused.
EDIT:
Never mind solved the problem [import]uid: 72845 topic_id: 34149 reply_id: 137001[/import]