3
在模擬器小部件顯示得很好,但沒有在設備上,其中一些丟失。 所以我甚至更新了電暈,並開始從1.0遷移到圖形2.0引擎,寬度/高度似乎也沒有引起問題,但我仍然有這個問題。在模擬器中的Corona小部件展示,但不在設備上
這部分代碼: menu.lua
ExitBtn = widget.newButton{
defaultFile="images/exit.png",
overFile="images/exit2.png",
width=44, height=44,
onRelease = onExitBtnRelease
}
ExitBtn.anchorX,ExitBtn.anchorY = 0.5, 0.5
ExitBtn.x = display.contentWidth-28
ExitBtn.y = 24+50
InfoBtn = widget.newButton{
defaultFile="images/info.png",
overFile="images/info2.png"
width=46, height=46
--onRelease = onExitBtnRelease
}
InfoBtn.anchorX,InfoBtn.anchorY = 0.5, 0.5
InfoBtn.x = ExitBtn.x-ExitBtn.width-8
InfoBtn.y = ExitBtn.y+2
group:insert(bg1)
group:insert(bg2)
group:insert(background)
group:insert(playBtn)
group:insert(ScoresBtn)
group:insert(HowBtn)
group:insert(ExitBtn)
group:insert(InfoBtn)
這是onExitBtnRelease功能
local function onExitBtnRelease()
native.requestExit()
return true
end
菜單屏幕看起來應該像這樣(下面的鏈接),但在右上角按鈕丟失(在設備上)。 http://s9.postimg.org/rz1c8nu27/start_screen.png
謝謝,它被命名爲「Exit.png」,我甚至都沒有想過。 – markoal