quick cocos2d cc.ui.UIPushButton的使用

 

 

local button= cc.ui.UIPushButton.new({normal="UI/1.png",pressed="UI/bg.png",disabled="UI/1.png"},{scale9=true})    

:setButtonSize(100,200)
:setButtonLabel(cc.ui.UILabel.new({
UILabelType=2,
text="按钮",
size=30,
color=cc.c3b(255,255,255)
}))
:onButtonClicked(function(event) -- 按钮的clicked事件处理
print("pushButton click")
end)

:align(display.CENTER, display.left + 80, display.top - 80)
:addTo(self)

posted @ 2017-08-22 10:31  无止境!  阅读(229)  评论(0编辑  收藏  举报