Cocos2d-js controls common creation methods and coordinate conversion list
Genie
var sprite = new cc.Sprite(res.);sprite.setPosition(, );this.addChild(sprite);
Text tag
var label = new cc.LabelTTF("", "", 30);label.x = ;label.y = ;this.addChild(label);
Numeric tag
var atlas = new cc.LabelAtlas("", res., , , "");atlas.x = ;atlas.y = ;this.addChild(atlas);
Image menu items
var item = new cc.MenuItemImage(res., res., this.menuItemCallback, this);item.x = ;item.y = ;menuItemCallback:function(sender){cc.log("menuItemStartCallback")},
Menu
var menu = new cc.Menu(item);menu.x = ;menu.y = ;this.addChild(menu);
Coordinate Conversion
{Cc. Point} convertToNodeSpace (worldPoint); // convert the world coordinates to the model coordinates. {Cc. Point} convertToNodeSpaceAR (worldPoint); // convert the world coordinates to the model coordinates. AR indicates relative to the anchor. {Cc. Point} convertTouchToNodeSpace (touch); // converts a touch Point from a world coordinate to a model coordinate. {Cc. Point} convertTouchToNodeSpaceAR (touch); // converts a touch Point from a world coordinate to a model coordinate. AR indicates relative to the anchor. {Cc. Point} convertToWorldSpace (nodePoint); // convert the model coordinates to the world coordinates. {Cc. Point} convertToWorldSpaceAR (nodePoint); // convert the model coordinates to the world coordinates. AR indicates relative to the anchor.