锚点改变之后节点坐标相应的改变

//转换坐标
    //锚点为(x,x)是的坐标转换成锚点为(0,0)的坐标
    //例如:把锚点(0.5,0.5)坐标(0,0)转换成
    //锚点(0.5,0.5)坐标(0 - pNode.getContentSize.width * 0.5,0 - pNode.getContentSize.Height * 0.5)
    static void anchorToLocalPos(CCNode* pNode)
    {
        pNode->setPositionX(pNode->getPositionX() + pNode->getContentSize().width * pNode->getAnchorPoint().x);
        pNode->setPositionY(pNode->getPositionY() + pNode->getContentSize().height * pNode->getAnchorPoint().y);
    }
原文地址:https://www.cnblogs.com/newlist/p/3145466.html