I’m fairly new to cocos, what is wrong with this?
`var TextButton = cc.MenuItem.extend({
initWithText: function (text, callback, node) {
var label = cc.LabelTTF.create(text, “Arial”, 24);
label.setAnchorPoint(0, 0);
label.setPosition(0, 0);
this.addChild(label);
this.initWithCallback(callback, node);
this.setContentSize(200, 24);
}
});
…
var newGame = new TextButton();
newGame.initWithText(“New Game”, function () {
var x = 3 + 2;
}, this);
newGame.setAnchorPoint(1, 1);
newGame.setPosition(size.width - 125, size.height - 25);
this.addChild(newGame);
…`