码迷,mamicode.com
首页 > 其他好文 > 详细

Cocos2xd__节点

时间:2020-03-06 15:16:15      阅读:83      评论:0      收藏:0      [点我收藏+]

标签:node   span   with   str   addchild   ldb   oid   help   重要   

class Node : public Ref

 

1. 节点创建:

  Node * Node::create()

 

2. 添加子节点:

  void addChild(Node *child)

  void addChild(Node *child, int zOrder)

  void addChild(Node *child, int localZOrder, int tag)

  void addChild(Node* child, int localZOrder, const std::string& name)

  void addChildHelper(Node* child, int localZOrder, int tag, const std::string &name, bool setTag)

3. 查找子节点:
  Node* getChildByTag(int tag) const

  Node* getChildByName(const std::string& name) const

4. 删除子节点:
  void removeChild(Node* child, bool cleanup /* = true */)

  void removeChildByTag(int tag, bool cleanup /* = true */)

  void removeChildByName(const std::string &name, bool cleanup)

  void Node::removeAllChildren()

  void Node::removeAllChildrenWithCleanup(bool cleanup)

  void Node::removeFromParent()

  void Node::removeFromParentAndCleanup(bool cleanup)

5. 两个重要属性:

  a. AnchorPoint

  b. Position

  技术图片

 

Cocos2xd__节点

标签:node   span   with   str   addchild   ldb   oid   help   重要   

原文地址:https://www.cnblogs.com/teternity/p/Cocos2xd__Node.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!