我在使用Corona SDK時有點新,而且我的主菜單按鈕有點問題。每當我按下按鈕時,它都不會移動或改變視圖;這些按鈕就會在標題屏幕中消失。主菜單的Corona SDK UI按鈕
module(..., package.seeall)
local ui = require ("ui")
local ui = require ("director")
local assetPath = "assets/"
local mainGroup = display.newGroup()
function new(params)
local titleScreen = display.newImageRect(assetPath .. "Law of Magic.jpg",
display.contentWidth, display.contentHeight)
titleScreen.x = display.contentWidth/2
titleScreen.y = 265
mainGroup:insert(titleScreen)
director:changeScene("titleScreen")
local newgame = ui.newButton{ default = assetPath .. "new game.png",
onRelease = function(event) director:changeScene("New game") end,}
newgame.x = display.contentWidth/2
newgame.y = 445
mainGroup:insert(newgame)
local continue = ui.newButton{ default = assetPath .. "continue.png",
onRelease = function(event) director:changeScene("Continue") end,}
continue.x = display.contentWidth/2
continue.y = 447
mainGroup:insert(continue)
local option = ui.newButton{ default = assetPath .. "option.png",
onRelease = function(event) director:changeScene("Option") end,}
option.x = display.contentWidth/2
option.y = 449
mainGroup:insert(option)
local help = ui.newButton{ default = assetPath .. "help.png",
onRelease = function(event) director:changeScene("Help") end,}
help.x = display.contentWidth/2
help.y = 451
mainGroup:insert(help)
local exitgame = ui.newButton{ default = assetPath .. "exit game.png",
onRelease = function(event) director:changeScene("Exit game") end,}
exitgame.x = display.contentWidth/2
exitgame.y = 453
mainGroup:insert(exitgame)
return mainGroup
end