I hae modified my code. but it seems that storyboard is still not working. Am I doing this wrong?
display.setStatusBar( display.HiddenStatusBar ) local widget = require("widget") local storyboard = require( "storyboard" ) local background = display.setDefault("background", 1) local flagButton = { { left = 25, top = 927, width = 55, height = 75, id = "languageEnglish", defaultFile = "flags/final/english.png", overFile = "flags/checked/english.png", onEvent = function() storyboard.gotoScene( "english" ) end, selected = true }, { left = 95, top = 927, width = 55, height = 75, id = "languageGerman", defaultFile = "flags/final/germany.png", overFile = "flags/checked/germany.png", onEvent = function() storyboard.gotoScene( "german" ) end, }, { left = 165, top = 927, width = 55, height = 75, id = "languageSpain", defaultFile = "flags/final/spain.png", overFile = "flags/checked/spain.png", onEvent = function() storyboard.gotoScene( "spain" ) end, }, { left = 235, top = 927, width = 55, height = 75, id = "languageItaly", defaultFile = "flags/final/italy.png", overFile = "flags/checked/italy.png", onEvent = function() storyboard.gotoScene( "italy" ) end, }, { left = 305, top = 927, width = 55, height = 75, id = "languageFrance", defaultFile = "flags/final/france.png", overFile = "flags/checked/france.png", onEvent = function() storyboard.gotoScene( "france" ) end, } } local tabBar = widget.newTabBar { top = display.contentHeight - 50, width = display.contentWidth, buttons = flagButton } storyboard.gotoScene( "english" )
main.lua
local widget = require( "widget" ) local storyboard = require( "storyboard" ) local scene = storyboard.newScene() -- Called when the scene's view does not exist: function scene:createScene(event) local group = self.view local background = display.newImage("Assets/menu/menu\_en.jpg", 380, 480) group:insert(background) local menu1 = display.newRect(193, 220, 350, 250) menu1.isVisible = hidden group:insert(menu1) local menu2 = display.newRect(563, 220, 350, 250) menu2.isVisible = hidden group:insert(menu2) local menu3 = display.newRect(193, 490, 350, 250) menu3.isVisible = hidden group:insert(menu3) local menu4 = display.newRect(563, 490, 350, 250) menu4.isVisible = hidden group:insert(menu4) local menu5 = display.newRect(193, 760, 350, 250) menu5.isVisible = hidden group:insert(menu5) local menu6 = display.newRect(563, 760, 350, 250) menu6.isVisible = hidden group:insert(menu6) local logo = display.newImage("Assets/happyTouchLogo.png", 100, 40) group:insert(logo) local function subMenu() storyboard.gotoScene() end local function happyTouchJingle(event) media.playSound("Assets/Sound/jingle.mp3") local animation = function() transition.to( logo, { time=300, xScale=2.0, yScale=2.0, transition=easing.linear} ) transition.to( logo, { time=200, xScale=1.0, yScale=1.0, delay=350 } ) end local stopSound = function() media.stopSound() end timer.performWithDelay(50, animation) timer.performWithDelay(5000, stopSound) end logo:addEventListener("tap", happyTouchJingle) menu1:addEventListener("tap", subMenu) end function scene:willEnterScene(event) group = self.view end -- Called immediately after scene has moved onscreen: function scene:enterScene(event) group = self.view end -- Called when scene is about to move offscreen: function scene:exitScene(event) group = self.view end -- Called AFTER scene has finished moving offscreen: function scene:didExitScene(event) group = self.view end -- Called prior to the removal of scene's "view" (display group) function scene:destroyScene(event) group = self.view end -- Called if/when overlay scene is displayed via storyboard.showOverlay() function scene:overlayBegan(event) group = self.view local overlay\_scene = event.sceneName -- overlay scene name end -- Called if/when overlay scene is hidden/removed via storyboard.hideOverlay() function scene:overlayEnded(event) group = self.view local overlay\_scene = event.sceneName -- overlay scene name end --------------------------------------------------------------------------------- -- END OF YOUR IMPLEMENTATION --------------------------------------------------------------------------------- scene:addEventListener("createScene", scene) scene:addEventListener("willEnterScene", scene) scene:addEventListener("enterScene", scene) scene:addEventListener("exitScene", scene) scene:addEventListener("didExitScene", scene) scene:addEventListener("destroyScene", scene) scene:addEventListener("overlayBegan", scene) scene:addEventListener("overlayEnded", scene) --------------------------------------------------------------------------------- return scene
english.lua