cocos2d-x  2.2.6
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
CCDisplayManager Class Reference

! CCDisplayManager manages CCBone's display More...

#include <CCDisplayManager.h>

Inheritance diagram for CCDisplayManager:
CCObject CCCopying

Public Member Functions

 CCDisplayManager ()
 ~CCDisplayManager ()
bool init (CCBone *bone)
virtual void initDisplayList (CCBoneData *boneData)
 Use CCBoneData to init the display list. More...
 
void addDisplay (CCDisplayData *displayData, int index)
 Add display and use _DisplayData init the display. More...
 
void addDisplay (CCNode *display, int index)
void removeDisplay (int index)
CCArraygetDecorativeDisplayList ()
CC_DEPRECATED_ATTRIBUTE void changeDisplayByIndex (int index, bool force)
CC_DEPRECATED_ATTRIBUTE void changeDisplayByName (const char *name, bool force)
void changeDisplayWithIndex (int index, bool force)
 Change display by index. More...
 
void changeDisplayWithName (const char *name, bool force)
CCNodegetDisplayRenderNode ()
DisplayType getDisplayRenderNodeType ()
int getCurrentDisplayIndex ()
virtual void setCurrentDecorativeDisplay (CCDecorativeDisplay *decoDisplay)
virtual CCDecorativeDisplaygetCurrentDecorativeDisplay ()
virtual CCDecorativeDisplaygetDecorativeDisplayByIndex (int index)
virtual void setVisible (bool visible)
 Sets whether the display is visible The default value is true, a node is default to visible. More...
 
virtual bool isVisible ()
 Determines if the display is visible. More...
 
CCSize getContentSize ()
CCRect getBoundingBox ()
CCPoint getAnchorPoint ()
CCPoint getAnchorPointInPoints ()
virtual bool containPoint (CCPoint &_point)
 Check if the position is inside the bone. More...
 
virtual bool containPoint (float x, float y)
 Check if the position is inside the bone. More...
 
- Public Member Functions inherited from CCObject
 CCObject (void)
virtual ~CCObject (void)
void release (void)
void retain (void)
CCObjectautorelease (void)
CCObjectcopy (void)
bool isSingleReference (void) const
unsigned int retainCount (void) const
virtual bool isEqual (const CCObject *pObject)
virtual void acceptVisitor (CCDataVisitor &visitor)
virtual void update (float dt)
- Public Member Functions inherited from CCCopying
virtual CCObjectcopyWithZone (CCZone *pZone)

Static Public Member Functions

static CCDisplayManagercreate (CCBone *bone)

Public Attributes

virtual bool
getForceChangeDisplay(void)\n\n
public bool 
m_bVisible
 getForceChangeDisplay More...
 
CCBonem_pBone
- Public Attributes inherited from CCObject
unsigned int m_uID
int m_nLuaID

Protected Attributes

CCArraym_pDecoDisplayList
CCNodem_pDisplayRenderNode
 Display render node. More...
 
DisplayType m_eDisplayType
 Display render node type. More...
 
CCDecorativeDisplaym_pCurrentDecoDisplay
 Include current display information, like contour sprite, etc. More...
 
int m_iDisplayIndex
 Current display index. More...
 
bool m_bForceChangeDisplay
- Protected Attributes inherited from CCObject
unsigned int m_uReference
unsigned int m_uAutoReleaseCount

Detailed Description

! CCDisplayManager manages CCBone's display

Constructor & Destructor Documentation

Member Function Documentation

void addDisplay ( CCDisplayData displayData,
int  index 
)

Add display and use _DisplayData init the display.

If index already have a display, then replace it. If index is current display index, then also change display to _index

Parameters
displayDatait include the display information, like DisplayType. If you want to create a sprite display, then create a CCSpriteDisplayData param
indexthe index of the display you want to replace or add to -1 : append display from back
void addDisplay ( CCNode display,
int  index 
)
CC_DEPRECATED_ATTRIBUTE void
changeDisplayByIndex
( int  index,
bool  force 
)
Deprecated:
please use changeDisplayWithIndex and changeDisplayWithName
CC_DEPRECATED_ATTRIBUTE void
changeDisplayByName
( const char *  name,
bool  force 
)
void changeDisplayWithIndex ( int  index,
bool  force 
)

Change display by index.

You can just use this method to change display in the display list. The display list is just used for this bone, and it is the displays you may use in every frame.

Note : if index is the same with prev index, the method will not effect

Parameters
indexThe index of the display you want to change
forceIf true, then force change display to specified display, or current display will set to display index edit in the flash every key frame.
void changeDisplayWithName ( const char *  name,
bool  force 
)
virtual bool containPoint ( CCPoint _point)
virtual

Check if the position is inside the bone.

virtual bool containPoint ( float  x,
float  y 
)
virtual

Check if the position is inside the bone.

static CCDisplayManager* create ( CCBone bone)
static
CCPoint getAnchorPoint ( )
CCPoint getAnchorPointInPoints ( )
CCRect getBoundingBox ( )
CCSize getContentSize ( )
virtual CCDecorativeDisplay*
getCurrentDecorativeDisplay
( )
virtual
int getCurrentDisplayIndex ( )
virtual CCDecorativeDisplay*
getDecorativeDisplayByIndex
( int  index)
virtual
CCArray* getDecorativeDisplayList ( )
CCNode* getDisplayRenderNode ( )
DisplayType
getDisplayRenderNodeType
( )
bool init ( CCBone bone)
virtual void initDisplayList ( CCBoneData boneData)
virtual

Use CCBoneData to init the display list.

If display is a sprite, and it have texture info in the TexutreData, then use TexutreData to init the display's anchor point If the display is a CCArmature, then create a new CCArmature

virtual bool isVisible ( )
virtual

Determines if the display is visible.

See also
setVisible(bool)
Returns
true if the node is visible, false if the node is hidden.
void removeDisplay ( int  index)
virtual void
setCurrentDecorativeDisplay
( CCDecorativeDisplay decoDisplay)
virtual
virtual void setVisible ( bool  visible)
virtual

Sets whether the display is visible The default value is true, a node is default to visible.

Parameters
visibletrue if the node is visible, false if the node is hidden.

Member Data Documentation

bool m_bForceChangeDisplay
protected
virtual bool
getForceChangeDisplay (void)\n
\n public bool m_bVisible

getForceChangeDisplay

setForceChangeDisplay Whether of not the bone is visible. Default is true

DisplayType m_eDisplayType
protected

Display render node type.

int m_iDisplayIndex
protected

Current display index.

CCBone* m_pBone
CCDecorativeDisplay*
m_pCurrentDecoDisplay
protected

Include current display information, like contour sprite, etc.

CCArray* m_pDecoDisplayList
protected
CCNode* m_pDisplayRenderNode
protected

Display render node.


The documentation for this class was generated from the following file: