怎样才能将 图片的左上角定位在point上?

imgButton->setPosition(Point(pointX,pointY));
这样定位是将图片中心点定位在 point上

怎样才能将 图片的左上角定位在point上?

setAnchorPoint(0,1);

imgButton->setAnchorPoint(Vec2(0, 1));


```


或者

imgButton->setAnchorPoint(Vec2::ANCHOR_TOP_LEFT); //二者等价


```


另外,同样可以用ANCHOR_TOP_RIGHT以及ANCHOR_MIDDLE_TOP, ANCHOR_MIDDLE_RIGHT等。

具体关于锚点(Anchor Point)和位置(Position)的关系参见这篇文章

http://cn.cocos2d-x.org/tutorial/show?id=1284