Menu and setAnchorPoint

Continuing the discussion from Menu ignores setAnchorPoint:

Like the previous post stated, the anchor point of the menu is not changing. Is this a bug or intended?
I’m using version 3.17.1

Thanks

Hi @xxYxx,
if you look at https://github.com/cocos2d/cocos2d-x/blob/v3/cocos/2d/CCMenu.cpp#L141
it is set to ignoreAnchorPointForPosition. So, any changes to the position will be applied to bottom left of the node (anchor point { 0, 0 }).

iirc, this is the default setting for all layer nodes that are meant to cover the entire screen. I think it is so that their default positions can remain as 0, 0 and need not be calculated at initialization i guess? While, their anchor points are at the center which is good for scaling and rotation.

I see.
Thanks

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.