我按照官方文档的例子写了下面的代码
//add start menu
var startItem = new cc.MenuItemImage(
res.Start_N_png,
res.Start_S_png,
function () {
cc.log("Menu is clicked!");
}, this);
startItem.attr({
width:100,
height:40,
x: size.width/2,
y: size.height/2,
anchorX: 0.5,
anchorY: 0.5
});
var menu = new cc.Menu(startItem);
menu.x = 0;
menu.y = 0;
this.addChild(menu, 1)
但是按可点击区域不对,左半边点不了,而下方按钮之外可以点
