local function callback()
--实现内容
end
local normalSp = cc.Sprite:create("facebooklike_normal.png")
local pressSp = cc.Sprite:create("facebooklike_press.png")
local disableSp = cc.Sprite:create("facebooklike_press.png")
--或者
-- local normalSp = cc.Scale9Sprite:createWithSpriteFrameName("facebooklike_normal.png")--可以从本地获取也可以从plist文件获取
-- local pressSp = cc.Scale9Sprite:createWithSpriteFrameName("facebooklike_normal.png")
-- local normalSp:setContentSize(cc.size(170, 60))
-- local pressSp:setContentSize(cc.size(170, 60))
-- btReg:setNormalImage(btn_normal)
-- btReg:setSelectedImage(btn_normal)
-- btReg:setDisabledImage(btn_normal)
-- btReg:setEnabled(false)
local btReg = cc.MenuItemSprite:create(normalSp,pressSp,disableSp)
btReg:registerScriptTapHandler(callback)
local btMenu = cc.Menu:create(btReg)
btMenu:setPosition(720, 75)
layer:addChild(btMenu, 2)
--实现内容
end
local normalSp = cc.Sprite:create("facebooklike_normal.png")
local pressSp = cc.Sprite:create("facebooklike_press.png")
local disableSp = cc.Sprite:create("facebooklike_press.png")
--或者
-- local normalSp = cc.Scale9Sprite:createWithSpriteFrameName("facebooklike_normal.png")--可以从本地获取也可以从plist文件获取
-- local pressSp = cc.Scale9Sprite:createWithSpriteFrameName("facebooklike_normal.png")
-- local normalSp:setContentSize(cc.size(170, 60))
-- local pressSp:setContentSize(cc.size(170, 60))
-- btReg:setNormalImage(btn_normal)
-- btReg:setSelectedImage(btn_normal)
-- btReg:setDisabledImage(btn_normal)
-- btReg:setEnabled(false)
local btReg = cc.MenuItemSprite:create(normalSp,pressSp,disableSp)
btReg:registerScriptTapHandler(callback)
local btMenu = cc.Menu:create(btReg)
btMenu:setPosition(720, 75)
layer:addChild(btMenu, 2)