我发现UIWidget设置锚点时不起作用,跟踪发现现在的UIWidget派生自CCNodeRGBA,当UIWidget调用setAnchorPoint时调用的是CCNode的方法。
void CCNode::setAnchorPoint(const CCPoint& point)
{
if( ! point.equals(m_obAnchorPoint))
{
m_obAnchorPoint = point;
m_obAnchorPointInPoints = ccp(m_obContentSize.width * m_obAnchorPoint.x, m_obContentSize.height * m_obAnchorPoint.y );
m_bTransformDirty = m_bInverseDirty = true;
}
}
UIWideget的m_obContentSize一直是{0,0},所以设置锚点点时一直不正确
有人遇到这问题吗?