The title practically says it all. What I want to do is make a function for a menu screen button called play, right? I use the Debug Draw UI for a faster button creation system, by the way. (Thought that might help you solve this…) But anyways, I can’t create good groups. Here is an example of what I’m trying to do.
[lua]–opens modes…
function openModes()
if menu then
menu.remove()
local modes = display.newGroup()
modes:insert(
local backButton = ui.newButton{
default = “back.png”,
over = “backOver.png”,
onPress = loadMenu,
text = “”,
size = 20,
emboss = true,
x = halfW,
y = 250
}
backButton.xScale = 3.5
backButton.yScale = 3.5
local easyButton = ui.newButton{
default = “buttonRed.png”,
over = “buttonRedOver.png”,
onPress = runGameEasy,
text = “Easy”,
size = 20,
emboss = true,
x = halfW,
y = 400
}
easyButton.xScale = 3.5
easyButton.yScale = 3.5
)
end
end
–function used to load menu if to say someone leaves a current game
function loadMenu()
if modes then
modes.remove()
local menu = display.newGroup()
menu:insert(
local playButton = ui.newButton{
default = “smallButton.png”,
over = “smallButtonOver.png”,
onPress = openModes,
text = “Play”,
size = 20,
emboss = true,
x = halfW,
y = 400
}
playButton.xScale = 3.5
playButton.yScale = 3.5
)
end
end
loadMenu()[/lua]
Typically I’ll receive some output like “Syntax error: C:\Users\Noah\Desktop\Bucket Ball\main.lua:55: unexpected symbol near ‘local’” I can’t figure out how to make this work… [import]uid: 76200 topic_id: 13841 reply_id: 313841[/import]