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

RGBA protocol that affects CCNode's color and opacity. More...

#include <CCProtocols.h>

Inheritance diagram for CCRGBAProtocol:
CCLabelBMFont CCLayerRGBA CCNodeRGBA CCLayerColor CCMenu CCControl CCAtlasNode CCMenuItem CCMotionStreak CCProgressTimer CCSprite CCArmature CCBone CCScale9Sprite CCSkeleton Widget

Public Member Functions

virtual void setColor (const ccColor3B &color)=0
 @ More...
 
virtual const ccColor3BgetColor (void)=0
 Returns color that is currently used. More...
 
local getColor ()
 Returns color that is currently used. More...
 
virtual const ccColor3BgetDisplayedColor (void)=0
 Returns the displayed color. More...
 
virtual GLubyte getDisplayedOpacity (void)=0
 Returns the displayed opacity. More...
 
local getDisplayedOpacity ()
 Returns the displayed opacity. More...
 
virtual GLubyte getOpacity (void)=0
 Returns the opacity. More...
 
local getOpacity ()
 Returns the opacity. More...
 
virtual void setOpacity (GLubyte opacity)=0
 Changes the opacity. More...
 
virtual void setOpacityModifyRGB (bool bValue)=0
 Changes the OpacityModifyRGB property. More...
 
local setOpacityModifyRGB ( local bValue)
 Changes the OpacityModifyRGB property. More...
 
virtual bool isOpacityModifyRGB (void)=0
 Returns whether or not the opacity will be applied using glColor(R,G,B,opacity) or glColor(opacity, opacity, opacity, opacity) More...
 
local isOpacityModifyRGB ()
 Returns whether or not the opacity will be applied using glColor(R,G,B,opacity) or glColor(opacity, opacity, opacity, opacity) More...
 
virtual bool isCascadeColorEnabled (void)=0
 whether or not color should be propagated to its children. More...
 
virtual void setCascadeColorEnabled (bool cascadeColorEnabled)=0
virtual void updateDisplayedColor (const ccColor3B &color)=0
 recursive method that updates display color More...
 
local updateDisplayedColor ( local color)
 recursive method that updates display color More...
 
virtual bool isCascadeOpacityEnabled (void)=0
 whether or not opacity should be propagated to its children. More...
 
virtual void setCascadeOpacityEnabled (bool cascadeOpacityEnabled)=0
local setCascadeOpacityEnabled ( local cascadeOpacityEnabled)
virtual void updateDisplayedOpacity (GLubyte opacity)=0
 recursive method that updates the displayed opacity. More...
 
local updateDisplayedOpacity ( local opacity)
 recursive method that updates the displayed opacity. More...
 

Detailed Description

RGBA protocol that affects CCNode's color and opacity.

Member Function Documentation

virtual const ccColor3B& getColor ( void  )
pure virtual

Returns color that is currently used.

Returns
The ccColor3B contains R,G,B bytes.

Implemented in CCNodeRGBA, Widget, CCScale9Sprite, CCLabelBMFont, CCLayerRGBA, CCAtlasNode, and CCControlButton.

local getColor (   )
pure virtual

Returns color that is currently used.

Returns
The ccColor3B contains R,G,B bytes.

Implemented in CCNodeRGBA, Widget, CCScale9Sprite, CCLabelBMFont, CCLayerRGBA, CCAtlasNode, and CCControlButton.

virtual const ccColor3B&
getDisplayedColor
( void  )
pure virtual

Returns the displayed color.

Returns
The ccColor3B contains R,G,B bytes.

Implemented in CCNodeRGBA, CCLabelBMFont, and CCLayerRGBA.

local getDisplayedColor (   )
pure virtual

Returns the displayed color.

Returns
The ccColor3B contains R,G,B bytes.

Implemented in CCNodeRGBA, CCLabelBMFont, and CCLayerRGBA.

virtual GLubyte getDisplayedOpacity ( void  )
pure virtual

Returns the displayed opacity.

Returns
The opacity of sprite, from 0 ~ 255

Implemented in CCNodeRGBA, CCLabelBMFont, and CCLayerRGBA.

local getDisplayedOpacity (   )
pure virtual

Returns the displayed opacity.

Returns
The opacity of sprite, from 0 ~ 255

Implemented in CCNodeRGBA, CCLabelBMFont, and CCLayerRGBA.

virtual GLubyte getOpacity ( void  )
pure virtual

Returns the opacity.

The opacity which indicates how transparent or opaque this node is. 0 indicates fully transparent and 255 is fully opaque.

Returns
The opacity of sprite, from 0 ~ 255

Implemented in CCNodeRGBA, Widget, CCScale9Sprite, CCLabelBMFont, CCLayerRGBA, CCMotionStreak, and CCControlButton.

local getOpacity (   )
pure virtual

Returns the opacity.

The opacity which indicates how transparent or opaque this node is. 0 indicates fully transparent and 255 is fully opaque.

Returns
The opacity of sprite, from 0 ~ 255

Implemented in CCNodeRGBA, Widget, CCScale9Sprite, CCLabelBMFont, CCLayerRGBA, CCMotionStreak, and CCControlButton.

virtual bool isCascadeColorEnabled ( void  )
pure virtual

whether or not color should be propagated to its children.

Implemented in CCNodeRGBA, CCLabelBMFont, and CCLayerRGBA.

local isCascadeColorEnabled (   )
pure virtual

whether or not color should be propagated to its children.

Implemented in CCNodeRGBA, CCLabelBMFont, and CCLayerRGBA.

virtual bool
isCascadeOpacityEnabled
( void  )
pure virtual

whether or not opacity should be propagated to its children.

Implemented in CCNodeRGBA, CCLabelBMFont, and CCLayerRGBA.

local isCascadeOpacityEnabled (   )
pure virtual

whether or not opacity should be propagated to its children.

Implemented in CCNodeRGBA, CCLabelBMFont, and CCLayerRGBA.

virtual bool isOpacityModifyRGB ( void  )
pure virtual

Returns whether or not the opacity will be applied using glColor(R,G,B,opacity) or glColor(opacity, opacity, opacity, opacity)

Returns
Returns opacity modify flag.

Implemented in CCNodeRGBA, CCSprite, CCScale9Sprite, CCLabelBMFont, CCLayerRGBA, CCMenu, CCAtlasNode, CCControl, CCMotionStreak, and CCSkeleton.

local isOpacityModifyRGB (   )
pure virtual

Returns whether or not the opacity will be applied using glColor(R,G,B,opacity) or glColor(opacity, opacity, opacity, opacity)

Returns
Returns opacity modify flag.

Implemented in CCNodeRGBA, CCSprite, CCScale9Sprite, CCLabelBMFont, CCLayerRGBA, CCMenu, CCAtlasNode, CCControl, CCMotionStreak, and CCSkeleton.

virtual void setCascadeColorEnabled ( bool  cascadeColorEnabled)
pure virtual

Implemented in CCNodeRGBA, CCLabelBMFont, and CCLayerRGBA.

local setCascadeColorEnabled ( local  cascadeColorEnabled)
pure virtual

Implemented in CCNodeRGBA, CCLabelBMFont, and CCLayerRGBA.

virtual void
setCascadeOpacityEnabled
( bool  cascadeOpacityEnabled)
pure virtual

Implemented in CCNodeRGBA, CCLabelBMFont, and CCLayerRGBA.

local setCascadeOpacityEnabled ( local  cascadeOpacityEnabled)
pure virtual

Implemented in CCNodeRGBA, CCLabelBMFont, and CCLayerRGBA.

virtual void setColor ( const ccColor3B color)
pure virtual
virtual void setOpacity ( GLubyte  opacity)
pure virtual

Changes the opacity.

Parameters
valueGoes from 0 to 255, where 255 means fully opaque and 0 means fully transparent.

Implemented in CCNodeRGBA, Widget, CCScale9Sprite, CCSprite, CCLayerColor, CCLabelBMFont, CCLayerRGBA, CCBone, CCAtlasNode, CCProgressTimer, CCMotionStreak, and CCControlButton.

local setOpacity ( local  opacity)
pure virtual

Changes the opacity.

Parameters
valueGoes from 0 to 255, where 255 means fully opaque and 0 means fully transparent.

Implemented in CCNodeRGBA, Widget, CCScale9Sprite, CCSprite, CCLayerColor, CCLabelBMFont, CCLayerRGBA, CCBone, CCAtlasNode, CCProgressTimer, CCMotionStreak, and CCControlButton.

virtual void setOpacityModifyRGB ( bool  bValue)
pure virtual

Changes the OpacityModifyRGB property.

If thie property is set to true, then the rendered color will be affected by opacity. Normally, r = r * opacity/255, g = g * opacity/255, b = b * opacity/255.

Parameters
bValuetrue then the opacity will be applied as: glColor(R,G,B,opacity); false then the opacity will be applied as: glColor(opacity, opacity, opacity, opacity);

Implemented in CCNodeRGBA, CCSprite, CCScale9Sprite, CCLabelBMFont, CCLayerRGBA, CCMenu, CCAtlasNode, CCControl, CCMotionStreak, and CCSkeleton.

local setOpacityModifyRGB ( local  bValue)
pure virtual

Changes the OpacityModifyRGB property.

If thie property is set to true, then the rendered color will be affected by opacity. Normally, r = r * opacity/255, g = g * opacity/255, b = b * opacity/255.

Parameters
bValuetrue then the opacity will be applied as: glColor(R,G,B,opacity); false then the opacity will be applied as: glColor(opacity, opacity, opacity, opacity);

Implemented in CCNodeRGBA, CCSprite, CCScale9Sprite, CCLabelBMFont, CCLayerRGBA, CCMenu, CCAtlasNode, CCControl, CCMotionStreak, and CCSkeleton.

virtual void updateDisplayedColor ( const ccColor3B color)
pure virtual

recursive method that updates display color

Implemented in CCNodeRGBA, CCSprite, CCLabelBMFont, CCLayerRGBA, and CCBone.

local updateDisplayedColor ( local  color)
pure virtual

recursive method that updates display color

Implemented in CCNodeRGBA, CCSprite, CCLabelBMFont, CCLayerRGBA, and CCBone.

virtual void updateDisplayedOpacity ( GLubyte  opacity)
pure virtual

recursive method that updates the displayed opacity.

Implemented in CCNodeRGBA, CCScale9Sprite, CCSprite, CCLabelBMFont, CCLayerRGBA, CCBone, and UICCLabelAtlas.

local updateDisplayedOpacity ( local  opacity)
pure virtual

recursive method that updates the displayed opacity.

Implemented in CCNodeRGBA, CCScale9Sprite, CCSprite, CCLabelBMFont, CCLayerRGBA, CCBone, and UICCLabelAtlas.


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