cocos2d-x  3.0-alpha0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
RGBAProtocol Class Referenceabstract

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

#include <CCProtocols.h>

Inheritance diagram for RGBAProtocol:
Label LabelBMFont LayerRGBA NodeRGBA Control LayerColor Menu AtlasNode Armature Bone CCSkeleton GUIRenderer Scale9Sprite MenuItem MotionStreak ProgressTimer Sprite

Public Member Functions

virtual void setColor (const Color3B &color)=0
 Changes the color with R,G,B bytes. More...
 
virtual const Color3BgetColor () const =0
 Returns color that is currently used. More...
 
virtual const Color3BgetDisplayedColor () const =0
 Returns the displayed color. More...
 
virtual GLubyte getDisplayedOpacity () const =0
 Returns the displayed opacity. More...
 
virtual GLubyte getOpacity () const =0
 Returns the opacity. More...
 
virtual void setOpacity (GLubyte opacity)=0
 Changes the opacity. More...
 
virtual void setOpacityModifyRGB (bool value)=0
 Changes the OpacityModifyRGB property. More...
 
virtual bool isOpacityModifyRGB () const =0
 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 () const =0
 whether or not color should be propagated to its children. More...
 
virtual void setCascadeColorEnabled (bool cascadeColorEnabled)=0
virtual void updateDisplayedColor (const Color3B &color)=0
 recursive method that updates display color More...
 
virtual bool isCascadeOpacityEnabled () const =0
 whether or not opacity should be propagated to its children. More...
 
virtual void setCascadeOpacityEnabled (bool cascadeOpacityEnabled)=0
virtual void updateDisplayedOpacity (GLubyte opacity)=0
 recursive method that updates the displayed opacity. More...
 

Detailed Description

RGBA protocol that affects Node's color and opacity.

Member Function Documentation

virtual const Color3B& getColor ( ) const
pure virtual

Returns color that is currently used.

Returns
The Color3B contains R,G,B bytes.

Implemented in NodeRGBA, Scale9Sprite, LabelBMFont, LayerRGBA, ControlButton, ProgressTimer, AtlasNode, and Label.

virtual const Color3B&
getDisplayedColor
( ) const
pure virtual

Returns the displayed color.

Returns
The Color3B contains R,G,B bytes.

Implemented in NodeRGBA, LabelBMFont, LayerRGBA, and Label.

virtual GLubyte getDisplayedOpacity ( ) const
pure virtual

Returns the displayed opacity.

Returns
The opacity of sprite, from 0 ~ 255

Implemented in NodeRGBA, LabelBMFont, LayerRGBA, and Label.

virtual GLubyte getOpacity ( ) const
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 NodeRGBA, Scale9Sprite, LabelBMFont, LayerRGBA, ControlButton, ProgressTimer, MotionStreak, and Label.

virtual bool isCascadeColorEnabled ( ) const
pure virtual

whether or not color should be propagated to its children.

Implemented in NodeRGBA, LabelBMFont, LayerRGBA, and Label.

virtual bool
isCascadeOpacityEnabled
( ) const
pure virtual

whether or not opacity should be propagated to its children.

Implemented in NodeRGBA, LabelBMFont, LayerRGBA, and Label.

virtual bool isOpacityModifyRGB ( ) const
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 NodeRGBA, Sprite, Scale9Sprite, LayerRGBA, LabelBMFont, Control, Menu, MotionStreak, AtlasNode, CCSkeleton, and Label.

virtual void setCascadeColorEnabled ( bool  cascadeColorEnabled)
pure virtual

Implemented in NodeRGBA, LabelBMFont, LayerRGBA, and Label.

virtual void
setCascadeOpacityEnabled
( bool  cascadeOpacityEnabled)
pure virtual

Implemented in NodeRGBA, LabelBMFont, LayerRGBA, and Label.

virtual void setColor ( const Color3B color)
pure virtual

Changes the color with R,G,B bytes.

Parameters
colorExample: Color3B(255,100,0) means R=255, G=100, B=0

Implemented in NodeRGBA, Sprite, LayerColor, Scale9Sprite, LabelBMFont, LayerRGBA, ControlButton, ProgressTimer, AtlasNode, Label, and ControlColourPicker.

virtual void setOpacity ( GLubyte  opacity)
pure virtual

Changes the opacity.

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

Implemented in NodeRGBA, Sprite, LayerColor, Scale9Sprite, LabelBMFont, LayerRGBA, ControlButton, ProgressTimer, MotionStreak, AtlasNode, and Label.

virtual void setOpacityModifyRGB ( bool  value)
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
valueIf true, then the opacity will be applied as: glColor(R,G,B,opacity); If false, then the opacity will be applied as: glColor(opacity, opacity, opacity, opacity);

Implemented in NodeRGBA, Sprite, Scale9Sprite, LayerRGBA, LabelBMFont, Control, Menu, MotionStreak, AtlasNode, CCSkeleton, and Label.

virtual void updateDisplayedColor ( const Color3B color)
pure virtual

recursive method that updates display color

Implemented in NodeRGBA, Sprite, Scale9Sprite, LabelBMFont, LayerRGBA, Bone, and Label.

virtual void updateDisplayedOpacity ( GLubyte  opacity)
pure virtual

recursive method that updates the displayed opacity.

Implemented in NodeRGBA, Sprite, Scale9Sprite, LabelBMFont, LayerRGBA, Bone, Label, and UICCLabelAtlas.


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