cocos2d-x 3.0
- 首页 - 相关页面 - 模块 - 命名空间 - - 文件 -
Public 成员函数 - 图1 Public 成员函数 - 图2)
- 类列表 - 类索引 - 类继承关系 - 类成员

全部)) 命名空间) 文件) 函数) 变量) 类型定义) 枚举) 枚举值) 属性) 友元) 宏定义)))

Public 成员函数 | 静态 Public 成员函数 | Protected 属性 | 所有成员列表

DisplayManager类 参考

! DisplayManager管理骨骼(Bone)的显示 NA NA 更多…

#include

类 DisplayManager 继承关系图:

Public 成员函数 - 图3 Ref

## Public 成员函数
DisplayManager ()
~DisplayManager ()
bool init (Bone bone)
virtual void initDisplayList (BoneData boneData)
使用骨骼数据(BoneData)初始化显示列表. 更多…
void addDisplay (DisplayData displayData, int index)
添加显示对象,然后用_DisplayData初始化显示对象. 更多…
void addDisplay (cocos2d::Node display, int index)
void removeDisplay (int index)
const cocos2d::Vector < DecorativeDisplay > & getDecorativeDisplayList () const
CC_DEPRECATED_ATTRIBUTE void changeDisplayByIndex (int index, bool force)
CC_DEPRECATED_ATTRIBUTE void changeDisplayByName (const std::string &name, bool force)
void changeDisplayWithIndex (int index, bool force)
通过index来切换显示对象,你可以使用这个方法在切换在显示列表中得显示对象 该显示列表只用于这个骨骼动画,它是可应用在每一帧的显示对象 更多…
void changeDisplayWithName (const std::string &name, bool force)
cocos2d::Node getDisplayRenderNode () const
DisplayType getDisplayRenderNodeType () const
int getCurrentDisplayIndex () const
virtual void setCurrentDecorativeDisplay (DecorativeDisplay decoDisplay)
virtual DecorativeDisplay getCurrentDecorativeDisplay () const
virtual DecorativeDisplay getDecorativeDisplayByIndex (int index) const
virtual void setVisible (bool visible)
设置显示对象是否可见 默认值是true,一个节点默认是可见的 更多…
virtual bool isVisible () const
确定显示对象是否可见 更多…
cocos2d::Size getContentSize () const
cocos2d::Rect getBoundingBox () const
cocos2d::Vec2 getAnchorPoint () const
cocos2d::Vec2 getAnchorPointInPoints () const
virtual bool containPoint (cocos2d::Vec2 &_point)
检查给定位置是否在骨骼内部. 更多…
virtual bool containPoint (float x, float y)
检查给定位置是否在骨骼内部. 更多…
virtual void setForceChangeDisplay (bool force)
virtual bool isForceChangeDisplay () const
- Public 成员函数 继承自 Ref
void retain ()
保留所有权. 更多…
void release ()
立即释放所有权. 更多…
Ref autorelease ()
自动释放所有权在不久的将来. 更多…
unsigned int getReferenceCount () const
返回Ref对象当前的引用计数. 更多…
virtual ~Ref ()
NA NA 更多…
## 静态 Public 成员函数
static DisplayManager create (Bone bone)
## Protected 属性
cocos2d::Vector < DecorativeDisplay > _decoDisplayList
cocos2d::Node _displayRenderNode
显示渲染节点. 更多…
DisplayType _displayType
显示渲染节点类型 更多…
DecorativeDisplay _currentDecoDisplay
包括当前显示信息,比如轮廓,精灵等. 更多…
int _displayIndex
当前的显示索引 更多…
bool _forceChangeDisplay
bool _visible
骨骼是否可见的,默认是true 更多…
Bone _bone
- Protected 属性 继承自 Ref
unsigned int _referenceCount
引用计数 更多…
## 额外继承的成员函数
- Protected 成员函数 继承自 Ref
Ref ()
构造函数 更多…

详细描述

! DisplayManager管理骨骼(Bone)的显示 NA NA

构造及析构函数说明

DisplayManager ( )

~DisplayManager ( )

成员函数说明

void addDisplay ( DisplayData * displayData,
int index
)

添加显示对象,然后用_DisplayData初始化显示对象.

如果索引位置已经有了显示对象,就替换掉. 如果索引位置就是当前显示所在的索引,就把当前显示切换为_index

  • 参数
  • displayData包含显示信息,比如显示类型. 如果要创建一个精灵显示,就创建一个SpriteDisplayData参数 index需要替换或者添加的显示的索引 -1 : 从后台添加的显示

void addDisplay ( cocos2d::Node * display,
int index
)

CC_DEPRECATED_ATTRIBUTE void changeDisplayByIndex ( int index,
bool force
)

CC_DEPRECATED_ATTRIBUTE void changeDisplayByName ( const std::string & name,
bool force
)

void changeDisplayWithIndex ( int index,
bool force
)

通过index来切换显示对象,你可以使用这个方法在切换在显示列表中得显示对象 该显示列表只用于这个骨骼动画,它是可应用在每一帧的显示对象

Note : 如果索引(index)与上一个显示对象索引相同,这个方法不会起作用

  • 参数
  • index要切换的显示对象索引 force如果是true,就强制切换当前显示到指定的显示对象,或者当前显示会设置为在flash每一个关键帧中编辑的显示对象索引

void changeDisplayWithName ( const std::string & name,
bool force
)

virtual bool containPoint ( cocos2d::Vec2 & _point)

virtual

检查给定位置是否在骨骼内部.

virtual bool containPoint ( float x,
float y
)

virtual

检查给定位置是否在骨骼内部.

static DisplayManager create ( Bone bone)

static

cocos2d::Vec2 getAnchorPoint ( ) const

cocos2d::Vec2 getAnchorPointInPoints ( ) const

cocos2d::Rect getBoundingBox ( ) const

cocos2d::Size getContentSize ( ) const

virtual DecorativeDisplay* getCurrentDecorativeDisplay ( ) const

virtual

int getCurrentDisplayIndex ( ) const

virtual DecorativeDisplay* getDecorativeDisplayByIndex ( int index) const

virtual

const cocos2d::Vector<DecorativeDisplay*>& getDecorativeDisplayList ( ) const

cocos2d::Node* getDisplayRenderNode ( ) const

DisplayType getDisplayRenderNodeType ( ) const

bool init ( Bone * bone)

virtual void initDisplayList ( BoneData * boneData)

virtual

使用骨骼数据(BoneData)初始化显示列表.

如果显示的是一个在TexutreData中有纹理信息的精灵,就使用TexutreData去初始化显示的锚点 如果显示的是骨架(Armature),就创建一个新的骨架

virtual bool isForceChangeDisplay ( ) const

inlinevirtual

virtual bool isVisible ( ) const

virtual

确定显示对象是否可见

  • 返回
  • true 如果节点可见返回true,如果节点隐藏返回false

void removeDisplay ( int index)

virtual void setCurrentDecorativeDisplay ( DecorativeDisplay * decoDisplay)

virtual

virtual void setForceChangeDisplay ( bool force)

inlinevirtual

virtual void setVisible ( bool visible)

virtual

设置显示对象是否可见 默认值是true,一个节点默认是可见的

  • 参数
  • visible如果节点是可见的参数visible就是true,如果节点是隐藏的visible是false

类成员变量说明

Bone* _bone

protected

DecorativeDisplay* _currentDecoDisplay

protected

包括当前显示信息,比如轮廓,精灵等.

cocos2d::Vector<DecorativeDisplay*> _decoDisplayList

protected

int _displayIndex

protected

当前的显示索引

cocos2d::Node* _displayRenderNode

protected

显示渲染节点.

DisplayType _displayType

protected

显示渲染节点类型

bool _forceChangeDisplay

protected

bool _visible

protected

骨骼是否可见的,默认是true


该类的文档由以下文件生成:

  • /Users/zeroyang/Documents/github/cocos2d-x/cocos/editor-support/cocostudio/CCDisplayManager.h