Hi all,
I am newbie for cocos2d-x. I think setPosition is based on parent node, but I cannot explain why following code puts menu item at the left bottom.
[In the constructor of main scene]:
pMenuItem~~>setPosition );
m_pMenu~~>addChild(pMenuItem, i + 10000); <<<— The item should be at the left bottom of pMenu.
m_pMenu~~>setContentSize)); <<<— Set content size of pMenu to window size.
m_pMenu~~>setPosition(CCPointMake(0, 0)); <<<— Move pMenu to (0,0), so I think pMenuItem should be at (~~s.width/2,~~s.height/2), not (0, 0).
addChild(m_pMenu);
Thanks in advance,
Dream Studio.