! DisplayManager manages Bone's display More...
#include <CCDisplayManager.h>
Public Member Functions | |
DisplayManager () | |
~DisplayManager () | |
bool | init (Bone *bone) |
virtual void | initDisplayList (BoneData *boneData) |
Use BoneData to init the display list. More... | |
void | addDisplay (DisplayData *displayData, int index) |
Add display and use _DisplayData init the display. More... | |
void | addDisplay (cocos2d::Node *display, int index) |
void | removeDisplay (int index) |
const cocos2d::Vector < DecorativeDisplay * > & | getDecorativeDisplayList () const |
void | changeDisplayByIndex (int index, bool force) |
void | changeDisplayByName (const std::string &name, bool force) |
void | changeDisplayWithIndex (int index, bool force) |
Change display by index. More... | |
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) |
Sets whether the display is visible The default value is true, a node is default to visible. More... | |
virtual bool | isVisible () const |
Determines if the display is visible. More... | |
cocos2d::Size | getContentSize () const |
cocos2d::Rect | getBoundingBox () const |
cocos2d::Vec2 | getAnchorPoint () const |
cocos2d::Vec2 | getAnchorPointInPoints () const |
virtual bool | containPoint (cocos2d::Vec2 &_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... | |
virtual void | setForceChangeDisplay (bool force) |
virtual bool | isForceChangeDisplay () const |
Public Member Functions inherited from Ref | |
void | retain () |
Retains the ownership. More... | |
void | release () |
Releases the ownership immediately. More... | |
Ref * | autorelease () |
Releases the ownership sometime soon automatically. More... | |
unsigned int | getReferenceCount () const |
Returns the Ref's current reference count. More... | |
virtual | ~Ref () |
Static Public Member Functions | |
static DisplayManager * | create (Bone *bone) |
Protected Attributes | |
cocos2d::Vector < DecorativeDisplay * > | _decoDisplayList |
cocos2d::Node * | _displayRenderNode |
Display render node. More... | |
DisplayType | _displayType |
Display render node type. More... | |
DecorativeDisplay * | _currentDecoDisplay |
Include current display information, like contour sprite, etc. More... | |
int | _displayIndex |
Current display index. More... | |
bool | _forceChangeDisplay |
bool | _visible |
Whether of not the bone is visible. Default is true. More... | |
Bone * | _bone |
Protected Attributes inherited from Ref | |
unsigned int | _referenceCount |
count of references More... | |
Additional Inherited Members | |
Protected Member Functions inherited from Ref | |
Ref () | |
Constructor. More... | |
! DisplayManager manages Bone's display
DisplayManager | ( | ) |
~DisplayManager | ( | ) |
void addDisplay | ( | DisplayData * | 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
displayData | it include the display information, like DisplayType. If you want to create a sprite display, then create a SpriteDisplayData param |
index | the index of the display you want to replace or add to -1 : append display from back |
void addDisplay | ( | cocos2d::Node * | display, |
int | index | ||
) |
void changeDisplayByIndex | ( | int | index, |
bool | force | ||
) |
void changeDisplayByName | ( | const std::string & | 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
index | The index of the display you want to change |
force | If 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 std::string & | name, |
bool | force | ||
) |
|
virtual |
Check if the position is inside the bone.
|
virtual |
Check if the position is inside the bone.
|
static |
cocos2d::Vec2 getAnchorPoint | ( | ) | const |
cocos2d::Vec2 getAnchorPointInPoints |
( | ) | const |
cocos2d::Rect getBoundingBox | ( | ) | const |
cocos2d::Size getContentSize | ( | ) | const |
|
virtual |
int getCurrentDisplayIndex | ( | ) | const |
|
virtual |
const cocos2d::Vector <DecorativeDisplay*> & getDecorativeDisplayList |
( | ) | const |
cocos2d::Node* getDisplayRenderNode | ( | ) | const |
DisplayType getDisplayRenderNodeType |
( | ) | const |
bool init | ( | Bone * | bone | ) |
|
virtual |
|
inlinevirtual |
|
virtual |
Determines if the display is visible.
void removeDisplay | ( | int | index | ) |
|
virtual |
|
inlinevirtual |
|
virtual |
Sets whether the display is visible The default value is true, a node is default to visible.
visible | true if the node is visible, false if the node is hidden. |
|
protected |
|
protected |
Include current display information, like contour sprite, etc.
|
protected |
|
protected |
Current display index.
|
protected |
Display render node.
|
protected |
Display render node type.
|
protected |
|
protected |
Whether of not the bone is visible. Default is true.