【发布时间】:2012-12-01 00:54:56
【问题描述】:
我试图让我的按钮在释放后保持“按下”状态。现在我正在为电晕使用改进的按钮模块,我的默认图像是看起来未按下的按钮,而上方的图像被看起来按下的图像替换。
我想要做的是,一旦按下按钮,它就会停留在上方图像上。下面是我的代码是如何为我正在测试的按钮设置的。
local digButton = buttons.newButton{
default = "digButton.png",
over = "digButtonPressed.png",
onEvent = digButtonFunction,
id = "dig"
}
digButton:setReferencePoint(display.CenterReferencePoint)
digButton.x = display.contentWidth/5
digButton.y = display.contentHeight/1.9
另外,我有一个函数 (digButtonFunction) 将此按钮的 id 设置为一个变量,用于在用户按下此按钮后按下按钮时运行 if 语句。
【问题讨论】:
标签: image button replace coronasdk pressed