I tried that, but it doesn’t seem to make a difference. And for the record, line one here is line 42 in the code.
I recently was moving my app to Director Class, and this works fine on my old version, so I may have messed something up by changing it.
Here is the full code:
[lua]module(…, package.seeall)
new = function ()
local ui = require ( “ui” )
local vLabel = “”
local vReload = false
if type( params ) == “table” then
if type( params.label ) == “string” then
vLabel = params.label
end
if type( params.reload ) == “boolean” then
vReload = params.reload
end
end
local localGroup = display.newGroup()
local background = display.newImage( “ocean.png”, true )
local playButtonRelease = function(event)
director:changeScene( “play”, “crossfade” )
end
playButton:addEventListener( “tap”, playButtonRelease )
local howButtonRelease = function(event)
director:changeScene( “how”, “crossfade” )
end
howButton:addEventListener( “tap”, playButtonRelease )
local aboutButtonRelease = function(event)
director:changeScene( “about”, “crossfade” )
end
aboutButton:addEventListener( “tap”, aboutButtonRelease )
local settingsButtonRelease = function(event)
director:changeScene( “settings”, “crossfade” )
end
settingsButton:addEventListener(“tap”, settingsButtonRelease)
local function MainMenu
playButton = ui.newButton{
default = “Images/buttonWhite.png”,
over = “Images/buttonWhiteOver.png”,
onRelease = playButtonRelease,
text = “PLAY”,
font = “Arial Black”,
textColor = { 0, 0, 0, 255 },
size = 36,
emboss = true
}
playButton.x = 240
playButton.y = 75
local howButton = ui.newButton{
default = “Images/buttonWhite.png”,
over = “Images/buttonWhiteOver.png”,
onRelease = howButtonRelease,
text = “HOW TO PLAY”,
font = “Arial Black”,
textColor = { 0, 0, 0, 255 },
size = 32,
emboss = true
}
howButton.x = 240
howButton.y = 135
localGroup:insert( howButton )
local aboutButton = ui.newButton{
default = “Images/buttonWhite.png”,
over = “Images/buttonWhiteOver.png”,
text = “ABOUT”,
font = “Arial Black”,
textColor = { 0, 0, 0, 255 },
size = 36,
emboss = true
}
aboutButton.x = 240
aboutButton.y = 195
local settingsButton = ui.newButton{
default = “Images/buttonWhite.png”,
over = “Images/buttonWhiteOver.png”,
text = “SETTINGS”,
font = “Arial Black”,
textColor = { 0, 0, 0, 255 },
size = 36,
emboss = true
}
settingsButton.x = 240
settingsButton.y = 255
local initVars = function ()
localGroup:insert( background )
localGroup:insert( settingsButton )
localGroup:insert( aboutButton )
localGroup:insert( howButton )
localGroup:insert( playButton )
print(“Initializing Home”)
end
clean = function()
print(“Cleaning Home”)
end
mainMenu()
initVars()
return localGroup
end[/lua]
Thanks for your help! [import]uid: 38000 topic_id: 15866 reply_id: 58755[/import]