1. 程式人生 > >quick-cocos2dx之特效按鈕——縮放按鈕

quick-cocos2dx之特效按鈕——縮放按鈕

cc.ui.UIPushButton.new("Button01.png", {scale9 = true})
        :setButtonSize(200, 80)
        :setButtonLabel(cc.ui.UILabel.new({text = "REFRESH"}))
        :onButtonPressed(function(event)
            event.target:setScale(1.1)
        end)
        :onButtonRelease(function(event)
            event.target:setScale(1.0
) end) :onButtonClicked(function() app:enterScene("MainScene", nil, "flipy") end) :pos(display.cx, display.bottom + 100) :addTo(self)