Cocos2d-x  v4
CallbackCommand Class Reference

Callback command is used to invoke a callback function when this command is executed. More...

Inherits RenderCommand.

Public Member Functions

void execute ()
 Execute the render command and call callback functions.
 
- Public Member Functions inherited from RenderCommand
void init (float globalZOrder, const Mat4 &modelViewTransform, unsigned int flags)
 Init function, will be called by all the render commands. More...
 
float getGlobalOrder () const
 Get global Z order.
 
Type getType () const
 Returns the Command type.
 
bool isTransparent () const
 Returns whether is transparent.
 
void setTransparent (bool isTransparent)
 Set transparent flag.
 
bool isSkipBatching () const
 Get skip batching status, if a rendering is skip batching, it will be forced to be rendering separately.
 
void setSkipBatching (bool value)
 Set skip batching.
 
bool is3D () const
 Whether the command should be rendered at 3D mode.
 
void set3D (bool value)
 Set the command rendered in 3D mode or not.
 
float getDepth () const
 Get the depth by current model view matrix.
 
PipelineDescriptor & getPipelineDescriptor ()
 Can use the result to change the descriptor content.
 

Public Attributes

std::function< void()> func
 Callback function.
 

Additional Inherited Members

- Public Types inherited from RenderCommand
enum  Type {
  UNKNOWN_COMMAND, QUAD_COMMAND, CUSTOM_COMMAND, GROUP_COMMAND,
  MESH_COMMAND, TRIANGLES_COMMAND, CALLBACK_COMMAND
}
 Enum the type of render command. More...
 

Detailed Description

Callback command is used to invoke a callback function when this command is executed.

You can do some logic opertion in the callback, such as invoking renderer to set depth/stencil test. Don't suggest to invoke backen API in the callback function.


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