button的使用
local bt = ccui.Button:create()
bt:loadTextures("cr_btn_gr_n.png", "cr_btn_gr_p.png", "", 1)
bt:setScale9Enabled(true)
bt:setSize(cc.size(280, 60))
bt:setPosition(cc.p(180, 270 - i * 90))
bt:setTag(i)
imgBk:addChild(bt)
bt:addTouchEventListener(
function(sender, eventType)
if eventType == ccui.TouchEventType.ended then
ChristmasLayer._activeLayer:PlayerEffect("Sound.bundle/Bt_Press.mp3")
local nTag = sender:getTag()
callback(nTag)
layer:removeFromParent()
end
end
)