Cocos2d-x  v4
CameraBackgroundColorBrush Class Reference

Color brush clear buffer with given depth and color. More...

Inherits CameraBackgroundDepthBrush.

Public Member Functions

virtual BrushType getBrushType () const override
 Get brush type. More...
 
virtual void drawBackground (Camera *camera) override
 Draw background.
 
void setColor (const Color4F &color)
 Set clear color. More...
 
- Public Member Functions inherited from CameraBackgroundDepthBrush
void setDepth (float depth)
 Set depth. More...
 
- Public Member Functions inherited from Ref
void retain ()
 Retains the ownership. More...
 
void release ()
 Releases the ownership immediately. More...
 
Refautorelease ()
 Releases the ownership sometime soon automatically. More...
 
unsigned int getReferenceCount () const
 Returns the Ref's current reference count. More...
 
virtual ~Ref ()
 Destructor. More...
 

Static Public Member Functions

static CameraBackgroundColorBrushcreate (const Color4F &color, float depth)
 Create a color brush. More...
 
- Static Public Member Functions inherited from CameraBackgroundDepthBrush
static CameraBackgroundDepthBrushcreate (float depth)
 Create a depth brush. More...
 
- Static Public Member Functions inherited from CameraBackgroundBrush
static CameraBackgroundBrushcreateNoneBrush ()
 Creates a none brush, it does nothing when clear the background. More...
 
static CameraBackgroundDepthBrushcreateDepthBrush (float depth=1.f)
 Creates a depth brush, which clears depth buffer with a given depth. More...
 
static CameraBackgroundColorBrushcreateColorBrush (const Color4F &color, float depth)
 Creates a color brush. More...
 
static CameraBackgroundSkyBoxBrushcreateSkyboxBrush (const std::string &positive_x, const std::string &negative_x, const std::string &positive_y, const std::string &negative_y, const std::string &positive_z, const std::string &negative_z)
 Creates a Skybox brush with 6 textures. More...
 

Additional Inherited Members

- Public Types inherited from CameraBackgroundBrush
enum  BrushType
 Brush types. More...
 
- Public Attributes inherited from Ref
unsigned int _ID
 object id, ScriptSupport need public _ID
 
int _luaID
 Lua reference id.
 
void * _scriptObject
 scriptObject, support for swift
 
bool _rooted
 When true, it means that the object was already rooted.
 

Detailed Description

Color brush clear buffer with given depth and color.

Member Function Documentation

◆ getBrushType()

virtual BrushType getBrushType ( ) const
inlineoverridevirtual

Get brush type.

Should be BrushType::COLOR

Returns
brush type

Reimplemented from CameraBackgroundDepthBrush.

◆ create()

static CameraBackgroundColorBrush* create ( const Color4F color,
float  depth 
)
static

Create a color brush.

Parameters
colorColor used to clear the color buffer
depthDepth used to clear the depth buffer
Returns
Created brush

◆ setColor()

void setColor ( const Color4F color)

Set clear color.

Parameters
colorColor used to clear the color buffer

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