I have no clue what I’m doing wrong here. The “Play” button doesn’t show up on the simulator.
It tells me to put line 33 as a nil value.
[code]
module(…, package.seeall)
function new()
local menuGroup = display.newGroup()
local ui = require (“ui”)
local playBtn
local settings
local gameModes
local highscores
local title
–local achievements
local background = display.newImageRect(“background.png”, 800, 400)
background.x = display.contentWidth/2
background.y = display.contentHeight / 2
menuGroup:insert(background)
local title = display.newImage(“title.png”)
title.x = display.contentWidth/2
title.y = 50
menuGroup:insert(title)
local touchPlayBtn = function(event)
if event.phase == “release” and playBtn.isActive == true then
playBtn.isActive = false
director:changeScene(“game”)
end
end
playBtn = ui.newButton{
defaultSrc = “playBtn.png”,
defaultX = 125,
defaultY = 42,
overSrc = “playBtn-over.png”,
overX = 145,
overY = 62,
onEvent = touchPlayBtn,
id = “playBtn”,
}
playBtn.xOrigin = 25
playBtn.yOrigin= 600
transition.to (playBtn, { time = 1000, y = display.contentHeight/2, transition = easing.inOutExpo})
playBtn.isActive = true
menuGroup:insert(playBtn)
return menuGroup
end [import]uid: 114389 topic_id: 29507 reply_id: 329507[/import]