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

#include <UIWidget.h>

Inheritance diagram for UIWidget:
CCObject CCCopying UIButton UICheckBox UIImageView UILabel UILabelAtlas UILabelBMFont UILayout UILoadingBar UISlider UISwitch UITextField

Public Member Functions

 UIWidget (void)
virtual ~UIWidget ()
 Default destructor. More...
 
virtual void setEnabled (bool enabled)
 Sets whether the widget is enabled. More...
 
bool isEnabled () const
 Determines if the widget is enabled. More...
 
void setVisible (bool visible)
 Sets whether the widget is visible. More...
 
bool isVisible () const
 Determines if the widget is visible. More...
 
void setBright (bool bright)
 Sets whether the widget is bright. More...
 
bool isBright () const
 Determines if the widget is bright. More...
 
virtual void setTouchEnabled (bool enabled)
 Sets whether the widget is touch enabled. More...
 
void setBrightStyle (BrightStyle style)
 To set the bright style of widget. More...
 
bool isTouchEnabled () const
 Determines if the widget is touch enabled. More...
 
bool isFocused () const
 Determines if the widget is on focused. More...
 
void setFocused (bool fucosed)
 Sets whether the widget is on focused. More...
 
void setZOrder (int z)
 Sets the Z order which stands for the drawing order, and reorder this widget in its parent's children array. More...
 
int getZOrder ()
 Gets the Z order of this widget. More...
 
float getLeftInParent ()
 Gets the left boundary position of this widget. More...
 
float getBottomInParent ()
 Gets the bottom boundary position of this widget. More...
 
var getBottomInParent ()
 Gets the bottom boundary position of this widget. More...
 
float getRightInParent ()
 Gets the right boundary position of this widget. More...
 
float getTopInParent ()
 Gets the top boundary position of this widget. More...
 
virtual bool addChild (UIWidget *child)
 Adds a child to the container. More...
 
virtual bool removeChild (UIWidget *child)
 Removes a child from the container with a cleanup. More...
 
virtual void removeFromParent ()
 Removes this widget itself from its parent widget. More...
 
virtual void removeAllChildren ()
 Removes all children from the container, and do a cleanup to all running actions depending on the cleanup parameter. More...
 
virtual void reorderChild (UIWidget *child)
 Reorders a child according to a new z value. More...
 
UIWidgetgetChildByName (const char *name)
 Gets a child from the container with its name. More...
 
UIWidgetgetChildByTag (int tag)
 Gets a child from the container with its tag. More...
 
virtual CCArraygetChildren ()
 Return an array of children. More...
 
CCNodegetRenderer ()
 Gets the renderer of widget. More...
 
void addRenderer (CCNode *renderer, int zOrder)
 Add a CCNode for rendering. More...
 
void removeRenderer (CCNode *renderer, bool cleanup)
 Remove a CCNode from widget. More...
 
void setParent (UIWidget *parent)
 Sets the parent widget. More...
 
UIWidgetgetParent ()
 Returns a pointer to the parent widget. More...
 
void addTouchEventListener (CCObject *target, SEL_TouchEvent selector)
 Sets the touch event target/selector of the menu item. More...
 
var addTouchEventListener ( var target, var selector)
 Sets the touch event target/selector of the menu item. More...
 
void setPosition (const CCPoint &pos)
 Changes the position (x,y) of the widget in OpenGL coordinates. More...
 
void setPositionPercent (const CCPoint &percent)
 Changes the position (x,y) of the widget in OpenGL coordinates. More...
 
var setPositionPercent ( var percent)
 Changes the position (x,y) of the widget in OpenGL coordinates. More...
 
const CCPointgetPosition ()
 Gets the position (x,y) of the widget in OpenGL coordinates. More...
 
const CCPointgetPositionPercent ()
 Gets the percent (x,y) of the widget in OpenGL coordinates. More...
 
void setPositionType (PositionType type)
 Changes the position type of the widget. More...
 
PositionType getPositionType () const
 Gets the position type of the widget. More...
 
virtual void setAnchorPoint (const CCPoint &pt)
 Sets the anchor point in percent. More...
 
const CCPointgetAnchorPoint ()
 Returns the anchor point in percent. More...
 
virtual void setScale (float fScale)
 Changes both X and Y scale factor of the widget. More...
 
float getScale ()
 Gets the scale factor of the widget, when X and Y have the same scale factor. More...
 
virtual void setScaleX (float fScaleX)
 Changes the scale factor on X axis of this widget. More...
 
float getScaleX ()
 Returns the scale factor on X axis of this widget. More...
 
virtual void setScaleY (float fScaleY)
 Changes the scale factor on Y axis of this widget. More...
 
float getScaleY ()
 Returns the scale factor on Y axis of this widget. More...
 
void setRotation (float rotation)
 Sets the rotation (angle) of the widget in degrees. More...
 
float getRotation ()
 Returns the rotation of the widget in degrees. More...
 
void setRotationX (float rotationX)
 Sets the X rotation (angle) of the widget in degrees which performs a horizontal rotational skew. More...
 
float getRotationX ()
 Gets the X rotation (angle) of the widget in degrees which performs a horizontal rotation skew. More...
 
void setRotationY (float rotationY)
 Sets the Y rotation (angle) of the widget in degrees which performs a vertical rotational skew. More...
 
float getRotationY ()
 Gets the Y rotation (angle) of the widget in degrees which performs a vertical rotational skew. More...
 
virtual void setFlipX (bool flipX)
 Sets whether the widget should be flipped horizontally or not. More...
 
virtual bool isFlipX ()
 Returns the flag which indicates whether the widget is flipped horizontally or not. More...
 
virtual void setFlipY (bool flipY)
 Sets whether the widget should be flipped vertically or not. More...
 
virtual bool isFlipY ()
 Return the flag which indicates whether the widget is flipped vertically or not. More...
 
virtual void setColor (const ccColor3B &color)
 Sets color to widget. More...
 
virtual const ccColor3BgetColor ()
 Gets color of widget. More...
 
virtual void setOpacity (int opacity)
 Sets opacity to widget. More...
 
virtual int getOpacity ()
 Gets opacity of widget. More...
 
virtual bool isCascadeOpacityEnabled ()
virtual void setCascadeOpacityEnabled (bool cascadeOpacityEnabled)
virtual bool isCascadeColorEnabled ()
virtual void setCascadeColorEnabled (bool cascadeColorEnabled)
void setBlendFunc (ccBlendFunc blendFunc)
virtual void setActionManager (CCActionManager *actionManager)
virtual CCActionManagergetActionManager ()
CCActionrunAction (CCAction *action)
void stopAllActions (void)
void stopAction (CCAction *action)
void stopActionByTag (int tag)
CCActiongetActionByTag (int tag)
void didNotSelectSelf ()
 A call back function when widget lost of focus. More...
 
var didNotSelectSelf ()
 A call back function when widget lost of focus. More...
 
bool clippingParentAreaContainPoint (const CCPoint &pt)
virtual void checkChildInfo (int handleState, UIWidget *sender, const CCPoint &touchPoint)
const CCPointgetTouchStartPos ()
const CCPointgetTouchMovePos ()
const CCPointgetTouchEndPos ()
void setTag (int tag)
 Changes the tag that is used to identify the widget easily. More...
 
int getTag () const
 Returns a tag that is used to identify the widget easily. More...
 
void setName (const char *name)
 Changes the name that is used to identify the widget easily. More...
 
const char * getName () const
 Returns a name that is used to identify the widget easily. More...
 
var getName ()
 Returns a name that is used to identify the widget easily. More...
 
WidgetType getWidgetType () const
 Returns a type that is widget's type. More...
 
virtual void setSize (const CCSize &size)
 Changes the size that is widget's size. More...
 
virtual void setSizePercent (const CCPoint &percent)
 Changes the percent that is widget's percent size. More...
 
void setSizeType (SizeType type)
 Changes the size type of widget. More...
 
SizeType getSizeType () const
 Gets the size type of widget. More...
 
const CCSizegetSize () const
 Returns size of widget. More...
 
const CCPointgetSizePercent () const
 Returns size percent of widget. More...
 
virtual bool hitTest (const CCPoint &pt)
 Checks a point if is in widget's space. More...
 
virtual bool onTouchBegan (const CCPoint &touchPoint)
 A call back function called when widget is selected, and on touch began. More...
 
virtual void onTouchMoved (const CCPoint &touchPoint)
 A call back function called when widget is selected, and on touch moved. More...
 
virtual void onTouchEnded (const CCPoint &touchPoint)
 A call back function called when widget is selected, and on touch ended. More...
 
virtual void onTouchCancelled (const CCPoint &touchPoint)
 A call back function called when widget is selected, and on touch canceled. More...
 
virtual void onTouchLongClicked (const CCPoint &touchPoint)
 A call back function called when widget is selected, and on touch long clicked. More...
 
var onTouchLongClicked ( var touchPoint)
 A call back function called when widget is selected, and on touch long clicked. More...
 
void setLayoutParameter (UILayoutParameter *parameter)
 Sets a LayoutParameter to widget. More...
 
UILayoutParametergetLayoutParameter (LayoutParameterType type)
 Gets LayoutParameter of widget. More...
 
virtual void ignoreContentAdaptWithSize (bool ignore)
 Ignore the widget size. More...
 
bool isIgnoreContentAdaptWithSize () const
 Gets the widget if is ignore it's size. More...
 
CCPoint getWorldPosition ()
 Gets world position of widget. More...
 
CCPoint convertToWorldSpace (const CCPoint &pt)
 Converts a Point to world space coordinates. More...
 
virtual CCNodegetVirtualRenderer ()
 Gets the Virtual Renderer of widget. More...
 
void setUpdateEnabled (bool enable)
 Schedules the "update" method. More...
 
bool isUpdateEnabled ()
 is the "update" method scheduled. More...
 
virtual const CCSizegetContentSize () const
 Gets the content size of widget. More...
 
virtual const char * getDescription () const
 Returns the "class name" of widget. More...
 
UIWidgetclone ()
virtual void onEnter ()
virtual void onExit ()
virtual CCObjectgetUserObject ()
 Returns a user assigned CCObject. More...
 
virtual void setUserObject (CCObject *pUserObject)
 Returns a user assigned CCObject. More...
 
void setTouchEnable (bool enabled, bool containChildren=false)
 These methods will be removed. More...
 
void disable (bool containChildren=false)
void active (bool containChildren=false)
bool isActive ()
var isActive ()
void setBright (bool bright, bool containChild)
CCRect getRect ()
CCNodegetValidNode ()
void setWidgetZOrder (int z)
int getWidgetZOrder ()
float getRelativeLeftPos ()
var getRelativeLeftPos ()
float getRelativeBottomPos ()
float getRelativeRightPos ()
float getRelativeTopPos ()
CCNodegetContainerNode ()
void setWidgetParent (UIWidget *parent)
UIWidgetgetWidgetParent ()
void setWidgetTag (int tag)
int getWidgetTag ()
void addCCNode (CCNode *node)
void addPushDownEvent (CCObject *target, SEL_PushEvent selector)
var addPushDownEvent ( var target, var selector)
void addMoveEvent (CCObject *target, SEL_MoveEvent selector)
void addReleaseEvent (CCObject *target, SEL_ReleaseEvent selector)
void addCancelEvent (CCObject *target, SEL_CancelEvent selector)
bool removeChild (UIWidget *child, bool cleanup)
void removeFromParentAndCleanup (bool cleanup)
void removeAllChildrenAndCleanUp (bool cleanup)
void setActionTag (int tag)
int getActionTag ()
void updateSizeAndPosition ()
var updateSizeAndPosition ()
- 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 UIWidgetcreate ()
 Allocates and initializes a widget. More...
 

Protected Member Functions

virtual void onSizeChanged ()
virtual bool init ()
virtual void initRenderer ()
virtual void onPressStateChangedToNormal ()
virtual void onPressStateChangedToPressed ()
virtual void onPressStateChangedToDisabled ()
void pushDownEvent ()
void moveEvent ()
void releaseUpEvent ()
void cancelUpEvent ()
void longClickEvent ()
void updateAnchorPoint ()
var updateAnchorPoint ()
void copyProperties (UIWidget *model)
virtual UIWidgetcreateCloneInstance ()
virtual void copySpecialProperties (UIWidget *model)
virtual void copyClonedWidgetChildren (UIWidget *model)

Protected Attributes

bool m_bEnabled
 Highest control of widget. More...
 
bool m_bVisible
 is this widget visible More...
 
bool m_bBright
 is this widget bright More...
 
bool m_bTouchEnabled
 is this widget touch endabled More...
 
var m_bTouchEnabled
 is this widget touch endabled More...
 
bool m_bTouchPassedEnabled
 is the touch event should be passed More...
 
bool m_bFocus
 is the widget on focus More...
 
int m_nWidgetZOrder
 z-order value that affects the draw order and touch order More...
 
CCPoint m_anchorPoint
 anchor point normalized More...
 
UIWidgetm_pWidgetParent
 parent of widget More...
 
var m_pWidgetParent
 parent of widget More...
 
BrightStyle m_eBrightStyle
 bright style More...
 
bool m_bUpdateEnabled
 is "update" method scheduled More...
 
var m_bUpdateEnabled
 is "update" method scheduled More...
 
CCNodem_pRenderer
 base renderer More...
 
CCPoint m_touchStartPos
 touch began point More...
 
var m_touchStartPos
 touch began point More...
 
CCPoint m_touchMovePos
 touch moved point More...
 
CCPoint m_touchEndPos
 touch ended point More...
 
var m_touchEndPos
 touch ended point More...
 
CCObjectm_pTouchEventListener
SEL_TouchEvent m_pfnTouchEventSelector
var m_pfnTouchEventSelector
int m_nWidgetTag
std::string m_strName
var m_strName
WidgetType m_WidgetType
var m_WidgetType
int m_nActionTag
var m_nActionTag
CCSize m_size
var m_size
CCSize m_customSize
var m_customSize
CCDictionarym_pLayoutParameterDictionary
var m_pLayoutParameterDictionary
bool m_bIgnoreSize
var m_bIgnoreSize
CCArraym_children
var m_children
bool m_bAffectByClipping
var m_bAffectByClipping
CCSchedulerm_pScheduler
SizeType m_eSizeType
var m_eSizeType
CCPoint m_sizePercent
var m_sizePercent
PositionType m_ePositionType
var m_ePositionType
CCPoint m_positionPercent
var m_positionPercent
bool m_bIsRunning
CCObjectm_pUserObject
var m_pUserObject
CCObjectm_pPushListener
var m_pPushListener
SEL_PushEvent m_pfnPushSelector
var m_pfnPushSelector
CCObjectm_pMoveListener
SEL_MoveEvent m_pfnMoveSelector
var m_pfnMoveSelector
CCObjectm_pReleaseListener
SEL_ReleaseEvent m_pfnReleaseSelector
var m_pfnReleaseSelector
CCObjectm_pCancelListener
var m_pCancelListener
SEL_ReleaseEvent m_pfnCancelSelector
var m_pfnCancelSelector
- Protected Attributes inherited from CCObject
unsigned int m_uReference
unsigned int m_uAutoReleaseCount

Additional Inherited Members

- Public Attributes inherited from CCObject
unsigned int m_uID
int m_nLuaID

Constructor & Destructor Documentation

UIWidget ( void  )
var ctor (   )
virtual ~UIWidget ( )
virtual

Default destructor.

Member Function Documentation

void active ( bool  containChildren = false)
inline
var active ( var  containChildren = false)
inline
void addCancelEvent ( CCObject target,
SEL_CancelEvent  selector 
)
inline
var addCancelEvent ( var  target,
var  selector 
)
inline
void addCCNode ( CCNode node)
inline
var addCCNode ( var  node)
inline
virtual bool addChild ( UIWidget child)
virtual

Adds a child to the container.

Parameters
childA child widget

Reimplemented in UIScrollView, UILayout, UIPageView, UIListViewEx, and UIListView.

var addChild ( var  child)
virtual

Adds a child to the container.

Parameters
childA child widget

Reimplemented in UIScrollView, UILayout, UIPageView, UIListViewEx, and UIListView.

void addMoveEvent ( CCObject target,
SEL_MoveEvent  selector 
)
inline
var addMoveEvent ( var  target,
var  selector 
)
inline
void addPushDownEvent ( CCObject target,
SEL_PushEvent  selector 
)
inline
var addPushDownEvent ( var  target,
var  selector 
)
inline
void addReleaseEvent ( CCObject target,
SEL_ReleaseEvent  selector 
)
inline
var addReleaseEvent ( var  target,
var  selector 
)
inline
void addRenderer ( CCNode renderer,
int  zOrder 
)

Add a CCNode for rendering.

renderer is a CCNode, it's for drawing

Parameters
rendererA render node
zOrderZ order for drawing priority. Please refer to CCNode::setZOrder(int)
var addRenderer ( var  renderer,
var  zOrder 
)

Add a CCNode for rendering.

renderer is a CCNode, it's for drawing

Parameters
rendererA render node
zOrderZ order for drawing priority. Please refer to CCNode::setZOrder(int)
void addTouchEventListener ( CCObject target,
SEL_TouchEvent  selector 
)

Sets the touch event target/selector of the menu item.

var addTouchEventListener ( var  target,
var  selector 
)

Sets the touch event target/selector of the menu item.

void cancelUpEvent ( )
protected
var cancelUpEvent ( )
protected
virtual void checkChildInfo ( int  handleState,
UIWidget sender,
const CCPoint touchPoint 
)
virtual

Reimplemented in UIScrollView, UIPageView, and UIListView.

var checkChildInfo ( var  handleState,
var  sender,
var  touchPoint 
)
virtual

Reimplemented in UIScrollView, UIPageView, and UIListView.

bool clippingParentAreaContainPoint ( const CCPoint pt)
var clippingParentAreaContainPoint ( var  pt)
UIWidget* clone ( )
var clone ( )
CCPoint convertToWorldSpace ( const CCPoint pt)

Converts a Point to world space coordinates.

The result is in Points.

var convertToWorldSpace ( var  pt)

Converts a Point to world space coordinates.

The result is in Points.

virtual void
copyClonedWidgetChildren
( UIWidget model)
protectedvirtual
var copyClonedWidgetChildren ( var  model)
protectedvirtual
void copyProperties ( UIWidget model)
protected
var copyProperties ( var  model)
protected
virtual void copySpecialProperties ( UIWidget model)
protectedvirtual
var copySpecialProperties ( var  model)
protectedvirtual
static UIWidget* create ( )
static

Allocates and initializes a widget.

var create ( )
static

Allocates and initializes a widget.

void didNotSelectSelf ( )

A call back function when widget lost of focus.

var didNotSelectSelf ( )

A call back function when widget lost of focus.

void disable ( bool  containChildren = false)
inline
var disable ( var  containChildren = false)
inline
CCAction* getActionByTag ( int  tag)
var getActionByTag ( var  tag)
virtual CCActionManager*
getActionManager
( )
virtual
var getActionManager ( )
virtual
int getActionTag ( )
var getActionTag ( )
const CCPoint& getAnchorPoint ( )

Returns the anchor point in percent.

See Also
setAnchorPoint(const CCPoint&)
Returns
The anchor point of widget.
var getAnchorPoint ( )

Returns the anchor point in percent.

See Also
setAnchorPoint(const CCPoint&)
Returns
The anchor point of widget.
float getBottomInParent ( )

Gets the bottom boundary position of this widget.

Returns
The bottom boundary position of this widget.
var getBottomInParent ( )

Gets the bottom boundary position of this widget.

Returns
The bottom boundary position of this widget.
UIWidget* getChildByName ( const char *  name)

Gets a child from the container with its name.

Parameters
nameAn key to find the child widget.
Returns
a UIWidget object whose name equals to the input parameter
var getChildByName ( var  name)

Gets a child from the container with its name.

Parameters
nameAn key to find the child widget.
Returns
a UIWidget object whose name equals to the input parameter
UIWidget* getChildByTag ( int  tag)

Gets a child from the container with its tag.

Parameters
tagAn identifier to find the child widget.
Returns
a UIWidget object whose tag equals to the input parameter
var getChildByTag ( var  tag)

Gets a child from the container with its tag.

Parameters
tagAn identifier to find the child widget.
Returns
a UIWidget object whose tag equals to the input parameter
virtual CCArray* getChildren ( )
virtual

Return an array of children.

Composing a "tree" structure is a very important feature of UIWidget

Returns
An array of children

Reimplemented in UIScrollView, and UIListViewEx.

var getChildren ( )
virtual

Return an array of children.

Composing a "tree" structure is a very important feature of UIWidget

Returns
An array of children

Reimplemented in UIScrollView, and UIListViewEx.

virtual const ccColor3B& getColor ( )
virtual

Gets color of widget.

Returns
color
var getColor ( )
virtual

Gets color of widget.

Returns
color
CCNode* getContainerNode ( )
inline
var getContainerNode ( )
inline
virtual const CCSize&
getContentSize
( ) const
virtual

Gets the content size of widget.

Content size is widget's texture size.

Reimplemented in UISlider, UILayout, UITextField, UICheckBox, UIButton, UIImageView, UILabel, UILoadingBar, UILabelAtlas, and UILabelBMFont.

var getContentSize ( )
virtual

Gets the content size of widget.

Content size is widget's texture size.

Reimplemented in UISlider, UILayout, UITextField, UICheckBox, UIButton, UIImageView, UILabel, UILoadingBar, UILabelAtlas, and UILabelBMFont.

virtual const char* getDescription ( ) const
virtual
var getDescription ( )
virtual
UILayoutParameter*
getLayoutParameter
( LayoutParameterType  type)

Gets LayoutParameter of widget.

See Also
LayoutParameter
Parameters
typeRelative or Linear
Returns
LayoutParameter
var getLayoutParameter ( var  type)

Gets LayoutParameter of widget.

See Also
LayoutParameter
Parameters
typeRelative or Linear
Returns
LayoutParameter
float getLeftInParent ( )

Gets the left boundary position of this widget.

Returns
The left boundary position of this widget.
var getLeftInParent ( )

Gets the left boundary position of this widget.

Returns
The left boundary position of this widget.
const char* getName ( ) const

Returns a name that is used to identify the widget easily.

You can set tags to widget then identify them easily.

Returns
A const char* that identifies the widget.
var getName ( )

Returns a name that is used to identify the widget easily.

You can set tags to widget then identify them easily.

Returns
A const char* that identifies the widget.
virtual int getOpacity ( )
virtual

Gets opacity of widget.

Returns
opacity
var getOpacity ( )
virtual

Gets opacity of widget.

Returns
opacity
UIWidget* getParent ( )

Returns a pointer to the parent widget.

See Also
setParent(UIWidget*)
Returns
A pointer to the parnet widget
var getParent ( )

Returns a pointer to the parent widget.

See Also
setParent(UIWidget*)
Returns
A pointer to the parnet widget
const CCPoint& getPosition ( )

Gets the position (x,y) of the widget in OpenGL coordinates.

See Also
setPosition(const CCPoint&)
Returns
The position (x,y) of the widget in OpenGL coordinates
var getPosition ( )

Gets the position (x,y) of the widget in OpenGL coordinates.

See Also
setPosition(const CCPoint&)
Returns
The position (x,y) of the widget in OpenGL coordinates
const CCPoint& getPositionPercent ( )

Gets the percent (x,y) of the widget in OpenGL coordinates.

See Also
setPosition(const CCPoint&)
Returns
The percent (x,y) of the widget in OpenGL coordinates
var getPositionPercent ( )

Gets the percent (x,y) of the widget in OpenGL coordinates.

See Also
setPosition(const CCPoint&)
Returns
The percent (x,y) of the widget in OpenGL coordinates
PositionType getPositionType ( ) const

Gets the position type of the widget.

See Also
PositionType
Returns
type the position type of widget
var getPositionType ( )

Gets the position type of the widget.

See Also
PositionType
Returns
type the position type of widget
CCRect getRect ( )
inline
var getRect ( )
inline
float getRelativeBottomPos ( )
inline
var getRelativeBottomPos ( )
inline
float getRelativeLeftPos ( )
inline
var getRelativeLeftPos ( )
inline
float getRelativeRightPos ( )
inline
var getRelativeRightPos ( )
inline
float getRelativeTopPos ( )
inline
var getRelativeTopPos ( )
inline
CCNode* getRenderer ( )

Gets the renderer of widget.

renderer is a CCNode, it's for drawing

Returns
a CCNode object
var getRenderer ( )

Gets the renderer of widget.

renderer is a CCNode, it's for drawing

Returns
a CCNode object
float getRightInParent ( )

Gets the right boundary position of this widget.

Returns
The right boundary position of this widget.
var getRightInParent ( )

Gets the right boundary position of this widget.

Returns
The right boundary position of this widget.
float getRotation ( )

Returns the rotation of the widget in degrees.

See Also
setRotation(float)
Returns
The rotation of the widget in degrees.
var getRotation ( )

Returns the rotation of the widget in degrees.

See Also
setRotation(float)
Returns
The rotation of the widget in degrees.
float getRotationX ( )

Gets the X rotation (angle) of the widget in degrees which performs a horizontal rotation skew.

See Also
setRotationX(float)
Returns
The X rotation in degrees.
var getRotationX ( )

Gets the X rotation (angle) of the widget in degrees which performs a horizontal rotation skew.

See Also
setRotationX(float)
Returns
The X rotation in degrees.
float getRotationY ( )

Gets the Y rotation (angle) of the widget in degrees which performs a vertical rotational skew.

See Also
setRotationY(float)
Returns
The Y rotation in degrees.
var getRotationY ( )

Gets the Y rotation (angle) of the widget in degrees which performs a vertical rotational skew.

See Also
setRotationY(float)
Returns
The Y rotation in degrees.
float getScale ( )

Gets the scale factor of the widget, when X and Y have the same scale factor.

Warning
Assert when m_fScaleX != m_fScaleY.
See Also
setScale(float)
Returns
The scale factor of the widget.
var getScale ( )

Gets the scale factor of the widget, when X and Y have the same scale factor.

Warning
Assert when m_fScaleX != m_fScaleY.
See Also
setScale(float)
Returns
The scale factor of the widget.
float getScaleX ( )

Returns the scale factor on X axis of this widget.

See Also
setScaleX(float)
Returns
The scale factor on X axis.
var getScaleX ( )

Returns the scale factor on X axis of this widget.

See Also
setScaleX(float)
Returns
The scale factor on X axis.
float getScaleY ( )

Returns the scale factor on Y axis of this widget.

See Also
setScaleY(float)
Returns
The scale factor on Y axis.
var getScaleY ( )

Returns the scale factor on Y axis of this widget.

See Also
setScaleY(float)
Returns
The scale factor on Y axis.
const CCSize& getSize ( ) const

Returns size of widget.

Returns
size
var getSize ( )

Returns size of widget.

Returns
size
const CCPoint& getSizePercent ( ) const

Returns size percent of widget.

Returns
size percent
var getSizePercent ( )

Returns size percent of widget.

Returns
size percent
SizeType getSizeType ( ) const

Gets the size type of widget.

See Also
SizeType
Parameters
typethat is widget's size type
var getSizeType ( )

Gets the size type of widget.

See Also
SizeType
Parameters
typethat is widget's size type
int getTag ( ) const

Returns a tag that is used to identify the widget easily.

You can set tags to widget then identify them easily.

Returns
A interger that identifies the widget.
var getTag ( )

Returns a tag that is used to identify the widget easily.

You can set tags to widget then identify them easily.

Returns
A interger that identifies the widget.
float getTopInParent ( )

Gets the top boundary position of this widget.

Returns
The top boundary position of this widget.
var getTopInParent ( )

Gets the top boundary position of this widget.

Returns
The top boundary position of this widget.
const CCPoint& getTouchEndPos ( )
var getTouchEndPos ( )
const CCPoint& getTouchMovePos ( )
var getTouchMovePos ( )
const CCPoint& getTouchStartPos ( )
var getTouchStartPos ( )
virtual CCObject* getUserObject ( )
virtual

Returns a user assigned CCObject.

Similar to userData, but instead of holding a void* it holds an object

Returns
A user assigned CCObject
CCNode* getValidNode ( )
inline
var getValidNode ( )
inline
virtual CCNode* getVirtualRenderer ( )
virtual

Gets the Virtual Renderer of widget.

For example, a button's Virtual Renderer is it's texture renderer.

Returns
CCNode pointer.

Reimplemented in UISlider, UICheckBox, UITextField, UIButton, UIImageView, UILabel, UILoadingBar, UILabelAtlas, and UILabelBMFont.

var getVirtualRenderer ( )
virtual

Gets the Virtual Renderer of widget.

For example, a button's Virtual Renderer is it's texture renderer.

Returns
CCNode pointer.

Reimplemented in UISlider, UICheckBox, UITextField, UIButton, UIImageView, UILabel, UILoadingBar, UILabelAtlas, and UILabelBMFont.

UIWidget* getWidgetParent ( )
inline
var getWidgetParent ( )
inline
int getWidgetTag ( )
inline
var getWidgetTag ( )
inline
WidgetType getWidgetType ( ) const

Returns a type that is widget's type.

See Also
WidgetType
Returns
A WidgetType
var getWidgetType ( )

Returns a type that is widget's type.

See Also
WidgetType
Returns
A WidgetType
int getWidgetZOrder ( )
inline
var getWidgetZOrder ( )
inline
CCPoint getWorldPosition ( )

Gets world position of widget.

Returns
world position of widget.
var getWorldPosition ( )

Gets world position of widget.

Returns
world position of widget.
int getZOrder ( )

Gets the Z order of this widget.

See Also
setZOrder(int)
Returns
The Z order.
var getZOrder ( )

Gets the Z order of this widget.

See Also
setZOrder(int)
Returns
The Z order.
virtual bool hitTest ( const CCPoint pt)
virtual

Checks a point if is in widget's space.

Parameters
point
Returns
true if the point is in widget's space, flase otherwise.

Reimplemented in UILayout.

var hitTest ( var  pt)
virtual

Checks a point if is in widget's space.

Parameters
point
Returns
true if the point is in widget's space, flase otherwise.

Reimplemented in UILayout.

virtual void
ignoreContentAdaptWithSize
( bool  ignore)
virtual

Ignore the widget size.

Parameters
ignore,truethat widget will ignore it's size, use texture size, false otherwise. Default value is true.

Reimplemented in UISlider, UIButton, UILoadingBar, and UIImageView.

var ignoreContentAdaptWithSize ( var  ignore)
virtual

Ignore the widget size.

Parameters
ignore,truethat widget will ignore it's size, use texture size, false otherwise. Default value is true.

Reimplemented in UISlider, UIButton, UILoadingBar, and UIImageView.

virtual bool init ( )
protectedvirtual
virtual void initRenderer ( )
protectedvirtual
var initRenderer ( )
protectedvirtual
bool isActive ( )
inline
var isActive ( )
inline
bool isBright ( ) const

Determines if the widget is bright.

Returns
true if the widget is bright, false if the widget is dark.
var isBright ( )

Determines if the widget is bright.

Returns
true if the widget is bright, false if the widget is dark.
virtual bool isCascadeColorEnabled ( )
virtual
var isCascadeColorEnabled ( )
virtual
virtual bool
isCascadeOpacityEnabled
( )
virtual
var isCascadeOpacityEnabled ( )
virtual
bool isEnabled ( ) const

Determines if the widget is enabled.

Returns
true if the widget is enabled, false if the widget is disabled.
var isEnabled ( )

Determines if the widget is enabled.

Returns
true if the widget is enabled, false if the widget is disabled.
virtual bool isFlipX ( )
inlinevirtual

Returns the flag which indicates whether the widget is flipped horizontally or not.

It only flips the texture of the widget, and not the texture of the widget's children. Also, flipping the texture doesn't alter the anchorPoint. If you want to flip the anchorPoint too, and/or to flip the children too use: widget->setScaleX(sprite->getScaleX() * -1);

Returns
true if the widget is flipped horizaontally, false otherwise.

Reimplemented in UICheckBox, UIButton, UILabel, and UIImageView.

var isFlipX ( )
inlinevirtual

Returns the flag which indicates whether the widget is flipped horizontally or not.

It only flips the texture of the widget, and not the texture of the widget's children. Also, flipping the texture doesn't alter the anchorPoint. If you want to flip the anchorPoint too, and/or to flip the children too use: widget->setScaleX(sprite->getScaleX() * -1);

Returns
true if the widget is flipped horizaontally, false otherwise.

Reimplemented in UICheckBox, UIButton, UILabel, and UIImageView.

virtual bool isFlipY ( )
inlinevirtual

Return the flag which indicates whether the widget is flipped vertically or not.

It only flips the texture of the widget, and not the texture of the widget's children. Also, flipping the texture doesn't alter the anchorPoint. If you want to flip the anchorPoint too, and/or to flip the children too use: widget->setScaleY(widget->getScaleY() * -1);

Returns
true if the widget is flipped vertically, flase otherwise.

Reimplemented in UICheckBox, UIButton, UILabel, and UIImageView.

var isFlipY ( )
inlinevirtual

Return the flag which indicates whether the widget is flipped vertically or not.

It only flips the texture of the widget, and not the texture of the widget's children. Also, flipping the texture doesn't alter the anchorPoint. If you want to flip the anchorPoint too, and/or to flip the children too use: widget->setScaleY(widget->getScaleY() * -1);

Returns
true if the widget is flipped vertically, flase otherwise.

Reimplemented in UICheckBox, UIButton, UILabel, and UIImageView.

bool isFocused ( ) const

Determines if the widget is on focused.

Returns
true if the widget is on focused, false if the widget is not on focused.
var isFocused ( )

Determines if the widget is on focused.

Returns
true if the widget is on focused, false if the widget is not on focused.
bool isIgnoreContentAdaptWithSize ( ) const

Gets the widget if is ignore it's size.

Parameters
ignore,truethat widget will ignore it's size, use texture size, false otherwise. Default value is true.
var isIgnoreContentAdaptWithSize ( )

Gets the widget if is ignore it's size.

Parameters
ignore,truethat widget will ignore it's size, use texture size, false otherwise. Default value is true.
bool isTouchEnabled ( ) const

Determines if the widget is touch enabled.

Returns
true if the widget is touch enabled, false if the widget is touch disabled.
var isTouchEnabled ( )

Determines if the widget is touch enabled.

Returns
true if the widget is touch enabled, false if the widget is touch disabled.
bool isUpdateEnabled ( )

is the "update" method scheduled.

var isUpdateEnabled ( )

is the "update" method scheduled.

bool isVisible ( ) const

Determines if the widget is visible.

Returns
true if the widget is visible, false if the widget is hidden.
var isVisible ( )

Determines if the widget is visible.

Returns
true if the widget is visible, false if the widget is hidden.
void longClickEvent ( )
protected
var longClickEvent ( )
protected
void moveEvent ( )
protected
var moveEvent ( )
protected
virtual void onEnter ( )
virtual
var onEnter ( )
virtual
virtual void onExit ( )
virtual
var onExit ( )
virtual
virtual void
onPressStateChangedToDisabled
( )
protectedvirtual

Reimplemented in UISlider, UIButton, UICheckBox, and UILabel.

var onPressStateChangedToDisabled ( )
protectedvirtual

Reimplemented in UISlider, UIButton, UICheckBox, and UILabel.

virtual void
onPressStateChangedToNormal
( )
protectedvirtual

Reimplemented in UISlider, UIButton, UICheckBox, and UILabel.

var onPressStateChangedToNormal ( )
protectedvirtual

Reimplemented in UISlider, UIButton, UICheckBox, and UILabel.

virtual void
onPressStateChangedToPressed
( )
protectedvirtual

Reimplemented in UISlider, UIButton, UICheckBox, and UILabel.

var onPressStateChangedToPressed ( )
protectedvirtual

Reimplemented in UISlider, UIButton, UICheckBox, and UILabel.

virtual void onSizeChanged ( )
protectedvirtual
virtual bool onTouchBegan ( const CCPoint touchPoint)
virtual

A call back function called when widget is selected, and on touch began.

Parameters
touchpoint
Returns
true if the event should be pass to parent, flase otherwise.

Reimplemented in UIScrollView, UISlider, UIPageView, UITextField, UIListView, and UIImageView.

var onTouchBegan ( var  touchPoint)
virtual

A call back function called when widget is selected, and on touch began.

Parameters
touchpoint
Returns
true if the event should be pass to parent, flase otherwise.

Reimplemented in UIScrollView, UISlider, UIPageView, UITextField, UIListView, and UIImageView.

virtual void onTouchCancelled ( const CCPoint touchPoint)
virtual

A call back function called when widget is selected, and on touch canceled.

Parameters
touchpoint

Reimplemented in UIScrollView, UISlider, UIPageView, and UIListView.

var onTouchCancelled ( var  touchPoint)
virtual

A call back function called when widget is selected, and on touch canceled.

Parameters
touchpoint

Reimplemented in UIScrollView, UISlider, UIPageView, and UIListView.

virtual void onTouchEnded ( const CCPoint touchPoint)
virtual

A call back function called when widget is selected, and on touch ended.

Parameters
touchpoint

Reimplemented in UIScrollView, UISlider, UICheckBox, UIPageView, UIListView, and UIImageView.

var onTouchEnded ( var  touchPoint)
virtual

A call back function called when widget is selected, and on touch ended.

Parameters
touchpoint

Reimplemented in UIScrollView, UISlider, UICheckBox, UIPageView, UIListView, and UIImageView.

virtual void onTouchLongClicked ( const CCPoint touchPoint)
virtual

A call back function called when widget is selected, and on touch long clicked.

Parameters
touchpoint

Reimplemented in UIScrollView, and UIListView.

var onTouchLongClicked ( var  touchPoint)
virtual

A call back function called when widget is selected, and on touch long clicked.

Parameters
touchpoint

Reimplemented in UIScrollView, and UIListView.

virtual void onTouchMoved ( const CCPoint touchPoint)
virtual

A call back function called when widget is selected, and on touch moved.

Parameters
touchpoint

Reimplemented in UIScrollView, UISlider, UIPageView, and UIListView.

var onTouchMoved ( var  touchPoint)
virtual

A call back function called when widget is selected, and on touch moved.

Parameters
touchpoint

Reimplemented in UIScrollView, UISlider, UIPageView, and UIListView.

void pushDownEvent ( )
protected
var pushDownEvent ( )
protected
void releaseUpEvent ( )
protected
var releaseUpEvent ( )
protected
virtual void removeAllChildren ( )
virtual

Removes all children from the container, and do a cleanup to all running actions depending on the cleanup parameter.

Reimplemented in UIScrollView, UIPageView, UIListViewEx, and UIListView.

var removeAllChildren ( )
virtual

Removes all children from the container, and do a cleanup to all running actions depending on the cleanup parameter.

Reimplemented in UIScrollView, UIPageView, UIListViewEx, and UIListView.

void removeAllChildrenAndCleanUp ( bool  cleanup)
inline
var removeAllChildrenAndCleanUp ( var  cleanup)
inline
virtual bool removeChild ( UIWidget child)
virtual

Removes a child from the container with a cleanup.

Parameters
childThe child widget which will be removed.
Returns
the result of removing, succeeded or failed.

Reimplemented in UIScrollView, UIPageView, UIListViewEx, and UIListView.

var removeChild ( var  child)
virtual

Removes a child from the container with a cleanup.

Parameters
childThe child widget which will be removed.
Returns
the result of removing, succeeded or failed.

Reimplemented in UIScrollView, UIPageView, UIListViewEx, and UIListView.

bool removeChild ( UIWidget child,
bool  cleanup 
)
inline
var removeChild ( var  child,
var  cleanup 
)
inline
virtual void removeFromParent ( )
virtual

Removes this widget itself from its parent widget.

If the widget orphan, then it will destroy itself.

var removeFromParent ( )
virtual

Removes this widget itself from its parent widget.

If the widget orphan, then it will destroy itself.

void removeFromParentAndCleanup ( bool  cleanup)
inline
var removeFromParentAndCleanup ( var  cleanup)
inline
void removeRenderer ( CCNode renderer,
bool  cleanup 
)

Remove a CCNode from widget.

renderer is a CCNode, it's for drawing

Parameters
rendererA render node which needs to be removed
cleanuptrue if all running actions and callbacks on the render node will be cleanup, false otherwise.
var removeRenderer ( var  renderer,
var  cleanup 
)

Remove a CCNode from widget.

renderer is a CCNode, it's for drawing

Parameters
rendererA render node which needs to be removed
cleanuptrue if all running actions and callbacks on the render node will be cleanup, false otherwise.
virtual void reorderChild ( UIWidget child)
virtual

Reorders a child according to a new z value.

Parameters
childAn already added child node. It MUST be already added.
zOrderZ order for drawing priority and touched priority. Please refer to setZOrder(int)
var reorderChild ( var  child)
virtual

Reorders a child according to a new z value.

Parameters
childAn already added child node. It MUST be already added.
zOrderZ order for drawing priority and touched priority. Please refer to setZOrder(int)
CCAction* runAction ( CCAction action)
var runAction ( var  action)
virtual void setActionManager ( CCActionManager actionManager)
virtual
var setActionManager ( var  actionManager)
virtual
void setActionTag ( int  tag)
var setActionTag ( var  tag)
virtual void setAnchorPoint ( const CCPoint pt)
virtual

Sets the anchor point in percent.

anchorPoint is the point around which all transformations and positioning manipulations take place. It's like a pin in the widget where it is "attached" to its parent. The anchorPoint is normalized, like a percentage. (0,0) means the bottom-left corner and (1,1) means the top-right corner. But you can use values higher than (1,1) and lower than (0,0) too. The default anchorPoint is (0.5,0.5), so it starts in the center of the widget.

Parameters
anchorPointThe anchor point of widget.

Reimplemented in UITextField, UICheckBox, UIButton, UILabel, UIImageView, UILabelAtlas, and UILabelBMFont.

var setAnchorPoint ( var  pt)
virtual

Sets the anchor point in percent.

anchorPoint is the point around which all transformations and positioning manipulations take place. It's like a pin in the widget where it is "attached" to its parent. The anchorPoint is normalized, like a percentage. (0,0) means the bottom-left corner and (1,1) means the top-right corner. But you can use values higher than (1,1) and lower than (0,0) too. The default anchorPoint is (0.5,0.5), so it starts in the center of the widget.

Parameters
anchorPointThe anchor point of widget.

Reimplemented in UITextField, UICheckBox, UIButton, UILabel, UIImageView, UILabelAtlas, and UILabelBMFont.

void setBlendFunc ( ccBlendFunc  blendFunc)
var setBlendFunc ( var  blendFunc)
void setBright ( bool  bright)

Sets whether the widget is bright.

The default value is true, a widget is default to bright

Parameters
visibletrue if the widget is bright, false if the widget is dark.
var setBright ( var  bright)

Sets whether the widget is bright.

The default value is true, a widget is default to bright

Parameters
visibletrue if the widget is bright, false if the widget is dark.
void setBright ( bool  bright,
bool  containChild 
)
inline
var setBright ( var  bright,
var  containChild 
)
inline
void setBrightStyle ( BrightStyle  style)

To set the bright style of widget.

See Also
BrightStyle
Parameters
styleBRIGHT_NORMAL the widget is normal state, BRIGHT_HIGHLIGHT the widget is height light state.
var setBrightStyle ( var  style)

To set the bright style of widget.

See Also
BrightStyle
Parameters
styleBRIGHT_NORMAL the widget is normal state, BRIGHT_HIGHLIGHT the widget is height light state.
virtual void setCascadeColorEnabled ( bool  cascadeColorEnabled)
virtual
var setCascadeColorEnabled ( var  cascadeColorEnabled)
virtual
virtual void
setCascadeOpacityEnabled
( bool  cascadeOpacityEnabled)
virtual
var setCascadeOpacityEnabled ( var  cascadeOpacityEnabled)
virtual
virtual void setColor ( const ccColor3B color)
virtual

Sets color to widget.

It default change the color of widget's children.

Parameters
color

Reimplemented in UIButton, UITextField, and UILayout.

var setColor ( var  color)
virtual

Sets color to widget.

It default change the color of widget's children.

Parameters
color

Reimplemented in UIButton, UITextField, and UILayout.

virtual void setEnabled ( bool  enabled)
virtual

Sets whether the widget is enabled.

Highest control of widget. The default value is true, a widget is default to enabled

Parameters
enabledtrue if the widget is enabled, widget may be touched and visible, false if the widget is disabled, widget cannot be touched and hidden.
var setEnabled ( var  enabled)
virtual

Sets whether the widget is enabled.

Highest control of widget. The default value is true, a widget is default to enabled

Parameters
enabledtrue if the widget is enabled, widget may be touched and visible, false if the widget is disabled, widget cannot be touched and hidden.
virtual void setFlipX ( bool  flipX)
inlinevirtual

Sets whether the widget should be flipped horizontally or not.

Parameters
bFlipXtrue if the widget should be flipped horizaontally, false otherwise.

Reimplemented in UICheckBox, UIButton, UILabel, and UIImageView.

var setFlipX ( var  flipX)
inlinevirtual

Sets whether the widget should be flipped horizontally or not.

Parameters
bFlipXtrue if the widget should be flipped horizaontally, false otherwise.

Reimplemented in UICheckBox, UIButton, UILabel, and UIImageView.

virtual void setFlipY ( bool  flipY)
inlinevirtual

Sets whether the widget should be flipped vertically or not.

Parameters
bFlipYtrue if the widget should be flipped vertically, flase otherwise.

Reimplemented in UICheckBox, UIButton, UILabel, and UIImageView.

var setFlipY ( var  flipY)
inlinevirtual

Sets whether the widget should be flipped vertically or not.

Parameters
bFlipYtrue if the widget should be flipped vertically, flase otherwise.

Reimplemented in UICheckBox, UIButton, UILabel, and UIImageView.

void setFocused ( bool  fucosed)

Sets whether the widget is on focused.

The default value is false, a widget is default to not on focused

Parameters
fucosedtrue if the widget is on focused, false if the widget is not on focused.
var setFocused ( var  fucosed)

Sets whether the widget is on focused.

The default value is false, a widget is default to not on focused

Parameters
fucosedtrue if the widget is on focused, false if the widget is not on focused.
void setLayoutParameter ( UILayoutParameter parameter)

Sets a LayoutParameter to widget.

See Also
LayoutParameter
Parameters
LayoutParameterpointer
typeRelative or Linear
var setLayoutParameter ( var  parameter)

Sets a LayoutParameter to widget.

See Also
LayoutParameter
Parameters
LayoutParameterpointer
typeRelative or Linear
void setName ( const char *  name)

Changes the name that is used to identify the widget easily.

Parameters
Aconst char* that indentifies the widget.
var setName ( var  name)

Changes the name that is used to identify the widget easily.

Parameters
Aconst char* that indentifies the widget.
virtual void setOpacity ( int  opacity)
virtual

Sets opacity to widget.

It default change the opacity of widget's children.

Parameters
color

Reimplemented in UITextField, and UILayout.

var setOpacity ( var  opacity)
virtual

Sets opacity to widget.

It default change the opacity of widget's children.

Parameters
color

Reimplemented in UITextField, and UILayout.

void setParent ( UIWidget parent)

Sets the parent widget.

Parameters
parentA pointer to the parnet widget
var setParent ( var  parent)

Sets the parent widget.

Parameters
parentA pointer to the parnet widget
void setPosition ( const CCPoint pos)

Changes the position (x,y) of the widget in OpenGL coordinates.

Usually we use ccp(x,y) to compose CCPoint object. The original point (0,0) is at the left-bottom corner of screen.

Parameters
positionThe position (x,y) of the widget in OpenGL coordinates
var setPosition ( var  pos)

Changes the position (x,y) of the widget in OpenGL coordinates.

Usually we use ccp(x,y) to compose CCPoint object. The original point (0,0) is at the left-bottom corner of screen.

Parameters
positionThe position (x,y) of the widget in OpenGL coordinates
void setPositionPercent ( const CCPoint percent)

Changes the position (x,y) of the widget in OpenGL coordinates.

Usually we use ccp(x,y) to compose CCPoint object. The original point (0,0) is at the left-bottom corner of screen.

Parameters
percentThe percent (x,y) of the widget in OpenGL coordinates
var setPositionPercent ( var  percent)

Changes the position (x,y) of the widget in OpenGL coordinates.

Usually we use ccp(x,y) to compose CCPoint object. The original point (0,0) is at the left-bottom corner of screen.

Parameters
percentThe percent (x,y) of the widget in OpenGL coordinates
void setPositionType ( PositionType  type)

Changes the position type of the widget.

See Also
PositionType
Parameters
typethe position type of widget
var setPositionType ( var  type)

Changes the position type of the widget.

See Also
PositionType
Parameters
typethe position type of widget
void setRotation ( float  rotation)

Sets the rotation (angle) of the widget in degrees.

0 is the default rotation angle. Positive values rotate widget clockwise, and negative values for anti-clockwise.

Parameters
fRotationThe roration of the widget in degrees.
var setRotation ( var  rotation)

Sets the rotation (angle) of the widget in degrees.

0 is the default rotation angle. Positive values rotate widget clockwise, and negative values for anti-clockwise.

Parameters
fRotationThe roration of the widget in degrees.
void setRotationX ( float  rotationX)

Sets the X rotation (angle) of the widget in degrees which performs a horizontal rotational skew.

0 is the default rotation angle. Positive values rotate widget clockwise, and negative values for anti-clockwise.

Parameters
fRotationXThe X rotation in degrees which performs a horizontal rotational skew.
var setRotationX ( var  rotationX)

Sets the X rotation (angle) of the widget in degrees which performs a horizontal rotational skew.

0 is the default rotation angle. Positive values rotate widget clockwise, and negative values for anti-clockwise.

Parameters
fRotationXThe X rotation in degrees which performs a horizontal rotational skew.
void setRotationY ( float  rotationY)

Sets the Y rotation (angle) of the widget in degrees which performs a vertical rotational skew.

0 is the default rotation angle. Positive values rotate widget clockwise, and negative values for anti-clockwise.

Parameters
fRotationYThe Y rotation in degrees.
var setRotationY ( var  rotationY)

Sets the Y rotation (angle) of the widget in degrees which performs a vertical rotational skew.

0 is the default rotation angle. Positive values rotate widget clockwise, and negative values for anti-clockwise.

Parameters
fRotationYThe Y rotation in degrees.
virtual void setScale ( float  fScale)
virtual

Changes both X and Y scale factor of the widget.

1.0 is the default scale factor. It modifies the X and Y scale at the same time.

Parameters
scaleThe scale factor for both X and Y axis.

Reimplemented in UILabel.

var setScale ( var  fScale)
virtual

Changes both X and Y scale factor of the widget.

1.0 is the default scale factor. It modifies the X and Y scale at the same time.

Parameters
scaleThe scale factor for both X and Y axis.

Reimplemented in UILabel.

virtual void setScaleX ( float  fScaleX)
virtual

Changes the scale factor on X axis of this widget.

The deafult value is 1.0 if you haven't changed it before

Parameters
fScaleXThe scale factor on X axis.

Reimplemented in UILabel.

var setScaleX ( var  fScaleX)
virtual

Changes the scale factor on X axis of this widget.

The deafult value is 1.0 if you haven't changed it before

Parameters
fScaleXThe scale factor on X axis.

Reimplemented in UILabel.

virtual void setScaleY ( float  fScaleY)
virtual

Changes the scale factor on Y axis of this widget.

The Default value is 1.0 if you haven't changed it before.

Parameters
fScaleYThe scale factor on Y axis.

Reimplemented in UILabel.

var setScaleY ( var  fScaleY)
virtual

Changes the scale factor on Y axis of this widget.

The Default value is 1.0 if you haven't changed it before.

Parameters
fScaleYThe scale factor on Y axis.

Reimplemented in UILabel.

virtual void setSize ( const CCSize size)
virtual

Changes the size that is widget's size.

Parameters
sizethat is widget's size
var setSize ( var  size)
virtual

Changes the size that is widget's size.

Parameters
sizethat is widget's size
virtual void setSizePercent ( const CCPoint percent)
virtual

Changes the percent that is widget's percent size.

Parameters
percentthat is widget's percent size
var setSizePercent ( var  percent)
virtual

Changes the percent that is widget's percent size.

Parameters
percentthat is widget's percent size
void setSizeType ( SizeType  type)

Changes the size type of widget.

See Also
SizeType
Parameters
typethat is widget's size type
var setSizeType ( var  type)

Changes the size type of widget.

See Also
SizeType
Parameters
typethat is widget's size type
void setTag ( int  tag)

Changes the tag that is used to identify the widget easily.

Parameters
Ainterger that indentifies the widget.
var setTag ( var  tag)

Changes the tag that is used to identify the widget easily.

Parameters
Ainterger that indentifies the widget.
void setTouchEnable ( bool  enabled,
bool  containChildren = false 
)
inline

These methods will be removed.

var setTouchEnable ( var  enabled,
var  containChildren = false 
)
inline

These methods will be removed.

virtual void setTouchEnabled ( bool  enabled)
virtual

Sets whether the widget is touch enabled.

The default value is false, a widget is default to touch disabled

Parameters
visibletrue if the widget is touch enabled, false if the widget is touch disabled.
var setTouchEnabled ( var  enabled)
virtual

Sets whether the widget is touch enabled.

The default value is false, a widget is default to touch disabled

Parameters
visibletrue if the widget is touch enabled, false if the widget is touch disabled.
void setUpdateEnabled ( bool  enable)

Schedules the "update" method.

var setUpdateEnabled ( var  enable)

Schedules the "update" method.

virtual void setUserObject ( CCObject pUserObject)
virtual

Returns a user assigned CCObject.

Similar to UserData, but instead of holding a void* it holds an object. The UserObject will be retained once in this method, and the previous UserObject (if existed) will be relese. The UserObject will be released in CCNode's destructure.

Parameters
Auser assigned CCObject
void setVisible ( bool  visible)

Sets whether the widget is visible.

The default value is true, a widget is default to visible

Parameters
visibletrue if the widget is visible, false if the widget is hidden.
var setVisible ( var  visible)

Sets whether the widget is visible.

The default value is true, a widget is default to visible

Parameters
visibletrue if the widget is visible, false if the widget is hidden.
void setWidgetParent ( UIWidget parent)
inline
var setWidgetParent ( var  parent)
inline
void setWidgetTag ( int  tag)
inline
var setWidgetTag ( var  tag)
inline
void setWidgetZOrder ( int  z)
inline
var setWidgetZOrder ( var  z)
inline
void setZOrder ( int  z)

Sets the Z order which stands for the drawing order, and reorder this widget in its parent's children array.

The Z order of widget is relative to its "brothers": children of the same parent. It's nothing to do with OpenGL's z vertex. This one only affects the draw order of widgets in cocos2d. The larger number it is, the later this widget will be drawn in each message loop. Please refer to setVertexZ(float) for the difference.

Parameters
nZOrderZ order of this widget.
var setZOrder ( var  z)

Sets the Z order which stands for the drawing order, and reorder this widget in its parent's children array.

The Z order of widget is relative to its "brothers": children of the same parent. It's nothing to do with OpenGL's z vertex. This one only affects the draw order of widgets in cocos2d. The larger number it is, the later this widget will be drawn in each message loop. Please refer to setVertexZ(float) for the difference.

Parameters
nZOrderZ order of this widget.
void stopAction ( CCAction action)
var stopAction ( var  action)
void stopActionByTag ( int  tag)
var stopActionByTag ( var  tag)
void stopAllActions ( void  )
var stopAllActions (   )
void updateAnchorPoint ( )
protected
var updateAnchorPoint ( )
protected
void updateSizeAndPosition ( )
var updateSizeAndPosition ( )

Member Data Documentation

CCPoint m_anchorPoint
protected

anchor point normalized

var m_anchorPoint
protected

anchor point normalized

bool m_bAffectByClipping
protected
var m_bAffectByClipping
protected
bool m_bBright
protected

is this widget bright

var m_bBright
protected

is this widget bright

bool m_bEnabled
protected

Highest control of widget.

bool m_bFocus
protected

is the widget on focus

var m_bFocus
protected

is the widget on focus

bool m_bIgnoreSize
protected
var m_bIgnoreSize
protected
bool m_bIsRunning
protected
var m_bIsRunning
protected
bool m_bTouchEnabled
protected

is this widget touch endabled

var m_bTouchEnabled
protected

is this widget touch endabled

bool m_bTouchPassedEnabled
protected

is the touch event should be passed

var m_bTouchPassedEnabled
protected

is the touch event should be passed

bool m_bUpdateEnabled
protected

is "update" method scheduled

var m_bUpdateEnabled
protected

is "update" method scheduled

bool m_bVisible
protected

is this widget visible

var m_bVisible
protected

is this widget visible

CCArray* m_children
protected
var m_children
protected
CCSize m_customSize
protected
var m_customSize
protected
BrightStyle m_eBrightStyle
protected

bright style

var m_eBrightStyle
protected

bright style

PositionType m_ePositionType
protected
var m_ePositionType
protected
SizeType m_eSizeType
protected
var m_eSizeType
protected
int m_nActionTag
protected
var m_nActionTag
protected
int m_nWidgetTag
protected
var m_nWidgetTag
protected
int m_nWidgetZOrder
protected

z-order value that affects the draw order and touch order

var m_nWidgetZOrder
protected

z-order value that affects the draw order and touch order

CCObject* m_pCancelListener
protected
var m_pCancelListener
protected
SEL_ReleaseEvent
m_pfnCancelSelector
protected
var m_pfnCancelSelector
protected
SEL_MoveEvent m_pfnMoveSelector
protected
var m_pfnMoveSelector
protected
SEL_PushEvent m_pfnPushSelector
protected
var m_pfnPushSelector
protected
SEL_ReleaseEvent
m_pfnReleaseSelector
protected
var m_pfnReleaseSelector
protected
SEL_TouchEvent
m_pfnTouchEventSelector
protected
var m_pfnTouchEventSelector
protected
CCDictionary*
m_pLayoutParameterDictionary
protected
var m_pLayoutParameterDictionary
protected
CCObject* m_pMoveListener
protected
var m_pMoveListener
protected
CCPoint m_positionPercent
protected
var m_positionPercent
protected
CCObject* m_pPushListener
protected
var m_pPushListener
protected
CCObject* m_pReleaseListener
protected
CCNode* m_pRenderer
protected

base renderer

var m_pRenderer
protected

base renderer

CCScheduler* m_pScheduler
protected
var m_pScheduler
protected
CCObject* m_pTouchEventListener
protected
var m_pTouchEventListener
protected
CCObject* m_pUserObject
protected
var m_pUserObject
protected
UIWidget* m_pWidgetParent
protected

parent of widget

var m_pWidgetParent
protected

parent of widget

CCSize m_size
protected
var m_size
protected
CCPoint m_sizePercent
protected
var m_sizePercent
protected
std::string m_strName
protected
var m_strName
protected
CCPoint m_touchEndPos
protected

touch ended point

var m_touchEndPos
protected

touch ended point

CCPoint m_touchMovePos
protected

touch moved point

var m_touchMovePos
protected

touch moved point

CCPoint m_touchStartPos
protected

touch began point

var m_touchStartPos
protected

touch began point

WidgetType m_WidgetType
protected
var m_WidgetType
protected

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