cocos2d中Layer的默认锚点是left、buttom
sprite的锚点设置
setAnchorPoint(cc.p(0.5,0.5));
默认锚点:中心
setAnchorPoint(cc.p(0,0));
锚点:left、bottom(左下角)
setAnchorPoint(cc.p(0,1));
锚点:left、top(左上角)
setAnchorPoint(cc.p(1,0));
锚点:right、bottom(右下角)
setAnchorPoint(cc.p(1,1));
锚点:right、top(右上角)
var AnchorPointCenter = new cc.Point(0.5, 0.5); var AnchorPointTop = new cc.Point(0.5, 1); var AnchorPointTopRight = new cc.Point(1, 1); var AnchorPointRight = new cc.Point(1, 0.5); var AnchorPointBottomRight = new cc.Point(1, 0); var AnchorPointBottom = new cc.Point(0.5, 0); var AnchorPointBottomLeft = new cc.Point(0, 0); var AnchorPointLeft = new cc.Point(0, 0.5); var AnchorPointTopLeft = new cc.Point(0, 1);