Hi Jonjonsson,
Thank you for your response and the link. This was exactly what I needed. However, I am having problems with getting the “scene” stuff working. I have my entire app working from one single main.lua file. Do I need to have one file each for the individual scenes?
From my main screen which uses only display objects and not scene, I am trying to call a simple scene and getting errors. Any inputs or sample code will help. -thanks
I get this error in simulator:
"File: /Applications/My apps/main.lua
Line: 1238
Attempt to call field ‘gotoscene’ (a nil value)
"
main.lua
========
local storyboard = require “storyboard” – (almost at the top)
local function cluesL1(event)
–cluesScr()
storyboard.gotoscene( “scene”, “fade”, 400 ) --calling a simple scene, also tried show overlay
return true
end
scene.lua
=========
local storyboard = require( “storyboard” )
local scene = storyboard.newScene()
local scenebg, sceneRem, sceneShow, sceneBuy, sceneCancel
local function onCancTouch( self, event )
if event.phase == “began” then
storyboard.purgeScene( “scene” )
return true
end
end
– Called when the scene’s view does not exist:
function scene:createScene( event )
local screenGroup = self.view
scenebg = display.newImageRect(“cluesbg3.png”, 320, 420)
scenebg.x = display.contentCenterX;
scenebg.y = display.contentCenterY;
screenGroup:insert( scenebg )
--image.touch = onSceneTouch
sceneRem = display.newImageRect(“remletts.png”, 300, 100)
sceneRem.x = centerX
sceneRem.y = centerY - 80
screenGroup:insert( sceneRem )
--sceneRem.touch = onRemTouch
sceneShow = display.newImageRect(“showalpha.png”, 300, 100)
sceneShow.x = centerX
sceneShow.y = centerY + 20
screenGroup:insert( sceneShow )
--sceneShow.touch = onShowTouch
sceneBuy = display.newImageRect(“buycoins.png”, 100, 80)
sceneBuy.x = centerX - 60
sceneBuy.y = centerY + 120
screenGroup:insert( sceneBuy )
--sceneShow.touch = onShowTouch
sceneCancel = display.newImageRect(“cancelbutt.png”, 100, 80)
sceneCancel.x = centerX + 60
sceneCancel.y = centerY + 120
screenGroup:insert( sceneCancel )
sceneCancel.touch = onCancTouch
end
return scene
====================