I really appreciate you taking the time to answer. I do not get any errors; however, the buttons don’t respond when I click on them. In other words, the buttons do not take me to the next part of the storyboard. Below, I have copied the entire code for this file.
This is my first time coding in lua and I truly appreciate your help.
local storyboard = require( “storyboard” )
local scene = storyboard.newScene()
local widget = require “widget”
local startGameBtn
local function onStartGameBtnRelease( self, event )
storyboard.gotoScene( “startgame”)
return true
end
local characterBtn
local function onCharacterBtnRelease( self, event )
storyboard.gotoScene(“character”, “fade”, 500)
return true
end
function scene:createScene( event )
local group = self.view
sakura = display.newImageRect( “sakura.png”, display.contentWidth, display.contentHeight )
sakura:setReferencePoint( display.TopLeftReferencePoint )
sakura.x, sakura.y = 0, 0
titleLogo = display.newImageRect( “raindrop.png”, 300, 300 )
titleLogo:setReferencePoint( display.CenterReferencePoint )
titleLogo.x = 117
titleLogo.y = 83
startGameBtn = widget.newButton{
label=“start game”,
labelColor = { default={40}, over={100} },
default=“paint.png”,
over=“paint.png”,
width=100, height=40,
onRelease = onStartGameBtnRelease}
startGameBtn.view:setReferencePoint( display.CenterReferencePoint )
startGameBtn.view.x = 88
startGameBtn.view.y = 300
characterBtn = widget.newButton{
label=“characters”,
labelColor = { default={40}, over={100} },
default=“paint.png”,
over=“paint.png”,
width=100, height=40,
onRelease = onCharacterBtnRelease}
characterBtn.view:setReferencePoint( display.CenterReferencePoint )
characterBtn.view.x = 85
characterBtn.view.y = 275
group:insert( background )
group:insert( titleLogo )
group:insert( startGameBtn.view )
group:insert( characterBtn.view )
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
if startGameBtn then
startGameBtn:removeSelf()
startGameBtn = nil
end
end
scene:addEventListener( “createScene”, scene )
scene:addEventListener( “enterScene”, scene )
scene:addEventListener( “exitScene”, scene )
scene:addEventListener( “destroyScene”, scene )
return scene