修复批量节点的移动问题

This commit is contained in:
Nomango 2017-10-09 14:35:29 +08:00
parent a8e79e2974
commit 8ed4c25f6c
3 changed files with 28 additions and 0 deletions

View File

@ -99,6 +99,16 @@ bool BatchNode::del(Node * child)
return false; return false;
} }
int BatchNode::getCount()
{
return (int)m_vChildren.size();
}
std::vector<Node*>& BatchNode::getChildren()
{
return m_vChildren;
}
void BatchNode::clearAllChildren() void BatchNode::clearAllChildren()
{ {
// 所有节点的引用计数减一 // 所有节点的引用计数减一

View File

@ -60,6 +60,16 @@ bool BatchSprite::delSprite(Sprite * sprite)
return false; return false;
} }
int BatchSprite::getCount()
{
return (int)m_vSprites.size();
}
std::vector<Sprite*>& BatchSprite::getChildren()
{
return m_vSprites;
}
void BatchSprite::clearAllSprites() void BatchSprite::clearAllSprites()
{ {
// 所有节点的引用计数减一 // 所有节点的引用计数减一

View File

@ -561,6 +561,10 @@ public:
void add(Node *child, int z_Order = 0); void add(Node *child, int z_Order = 0);
// 删除子节点 // 删除子节点
bool del(Node * child); bool del(Node * child);
// 获取子节点数量
int getCount();
// 获取所有子节点
std::vector<Node*> &getChildren();
// 清空所有子节点 // 清空所有子节点
void clearAllChildren(); void clearAllChildren();
@ -840,6 +844,10 @@ public:
void addSprite(Sprite * sprite, int z_Order = 0); void addSprite(Sprite * sprite, int z_Order = 0);
// 删除精灵 // 删除精灵
bool delSprite(Sprite * child); bool delSprite(Sprite * child);
// 获取精灵数量
int getCount();
// 获取所有精灵
std::vector<Sprite*> &getChildren();
// 删除所有精灵 // 删除所有精灵
void clearAllSprites(); void clearAllSprites();
// 判断是否有精灵产生碰撞 // 判断是否有精灵产生碰撞