Cocos2d-x  v3.17
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Groups Pages
Sprite3DMaterial Class Reference

Sprite3DMaterial: Material for Sprite3D. More...

Inherits Material.

Public Types

enum  MaterialType
 Material type, there are mainly two types of materials. More...
 
- Public Types inherited from RenderState
enum  DepthFunction
 Defines the supported depth compare functions. More...
 
enum  CullFaceSide
 Defines culling criteria for front-facing, back-facing and both-side facets.
 
enum  FrontFace
 Defines the winding of vertices in faces that are considered front facing. More...
 
enum  StencilFunction
 Defines the supported stencil compare functions. More...
 
enum  StencilOperation
 Defines the supported stencil operations to perform. More...
 

Public Member Functions

MaterialType getMaterialType () const
 Get material type. More...
 
virtual Materialclone () const override
 Clone material.
 
local clone ()
 Clone material.
 
- Public Member Functions inherited from Material
std::string getName () const
 returns the material name
 
var getName ()
 returns the material name
 
local getName ()
 returns the material name
 
void setName (const std::string &name)
 sets the material name
 
var setName ( var name)
 sets the material name
 
local setName ( local name)
 sets the material name
 
TechniquegetTechniqueByName (const std::string &name)
 Returns a Technique by its name. More...
 
TechniquegetTechniqueByIndex (ssize_t index)
 Returns a Technique by index. More...
 
var getTechniqueByIndex ( var index)
 Returns a Technique by index. More...
 
local getTechniqueByIndex ( local index)
 Returns a Technique by index. More...
 
TechniquegetTechnique () const
 Returns the Technique used by the Material.
 
var getTechnique ()
 Returns the Technique used by the Material.
 
local getTechnique ()
 Returns the Technique used by the Material.
 
const Vector< Technique * > & getTechniques () const
 Returns the list of Techniques.
 
local getTechniques ()
 Returns the list of Techniques.
 
ssize_t getTechniqueCount () const
 Returns the number of Techniques in the Material. More...
 
local getTechniqueCount ()
 Returns the number of Techniques in the Material. More...
 
void addTechnique (Technique *technique)
 Adds a Technique into the Material.
 
var addTechnique ( var technique)
 Adds a Technique into the Material.
 
local addTechnique ( local technique)
 Adds a Technique into the Material.
 
void setTechnique (const std::string &techniqueName)
 Sets the current technique.
 
var setTechnique ( var techniqueName)
 Sets the current technique.
 
local setTechnique ( local techniqueName)
 Sets the current technique.
 
- Public Member Functions inherited from RenderState
void setTexture (Texture2D *texture)
 Texture that will use in the CC_Texture0 uniform. More...
 
var setTexture ( var texture)
 Texture that will use in the CC_Texture0 uniform. More...
 
local setTexture ( local texture)
 Texture that will use in the CC_Texture0 uniform. More...
 
Texture2DgetTexture () const
 Returns the texture that is going to be used for CC_Texture0. More...
 
void bind (Pass *pass)
 Binds the render state for this RenderState and any of its parents, top-down, for the given pass.
 
RenderStategetTopmost (RenderState *below)
 Returns the topmost RenderState in the hierarchy below the given RenderState.
 
var getTopmost ( var below)
 Returns the topmost RenderState in the hierarchy below the given RenderState.
 
local getTopmost ( local below)
 Returns the topmost RenderState in the hierarchy below the given RenderState.
 
- Public Member Functions inherited from Ref
void retain ()
 Retains the ownership. More...
 
void release ()
 Releases the ownership immediately. More...
 
local 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...
 
local getReferenceCount ()
 Returns the Ref's current reference count. More...
 
virtual ~Ref ()
 Destructor. More...
 

Static Public Member Functions

static Sprite3DMaterialcreateBuiltInMaterial (MaterialType type, bool skinned)
 Create built in material from material type. More...
 
var createBuiltInMaterial ( var type, var skinned)
 Create built in material from material type. More...
 
local createBuiltInMaterial ( local type, local skinned)
 Create built in material from material type. More...
 
static Sprite3DMaterialcreateWithFilename (const std::string &path)
 Create material with file name, it creates material from cache if it is previously loaded. More...
 
local createWithFilename ( local path)
 Create material with file name, it creates material from cache if it is previously loaded. More...
 
static Sprite3DMaterialcreateWithGLStateProgram (GLProgramState *programState)
 Create material with GLProgramState. More...
 
local createWithGLStateProgram ( local programState)
 Create material with GLProgramState. More...
 
static void createBuiltInMaterial ()
 Create all build in materials.
 
local createBuiltInMaterial ()
 Create all build in materials.
 
static void releaseBuiltInMaterial ()
 Release all built in materials.
 
local releaseBuiltInMaterial ()
 Release all built in materials.
 
static void releaseCachedMaterial ()
 Release all cached materials.
 
local releaseCachedMaterial ()
 Release all cached materials.
 
- Static Public Member Functions inherited from Material
static MaterialcreateWithFilename (const std::string &path)
 Creates a Material using the data from the Properties object defined at the specified URL, where the URL is of the format "<file-path>.<extension>#<namespace-id>/<namespace-id>/.../<namespace-id>" (and "#<namespace-id>/<namespace-id>/.../<namespace-id>" is optional). More...
 
local createWithFilename ( local path)
 Creates a Material using the data from the Properties object defined at the specified URL, where the URL is of the format "<file-path>.<extension>#<namespace-id>/<namespace-id>/.../<namespace-id>" (and "#<namespace-id>/<namespace-id>/.../<namespace-id>" is optional). More...
 
static MaterialcreateWithGLStateProgram (GLProgramState *programState)
 Creates a Material with a GLProgramState. More...
 
var createWithGLStateProgram ( var programState)
 Creates a Material with a GLProgramState. More...
 
static MaterialcreateWithProperties (Properties *materialProperties)
 Creates a material from the specified properties object. More...
 
var createWithProperties ( var materialProperties)
 Creates a material from the specified properties object. More...
 
- Static Public Member Functions inherited from RenderState
static void initialize ()
 Static initializer that is called during game startup.
 
var initialize ()
 Static initializer that is called during game startup.
 
local initialize ()
 Static initializer that is called during game startup.
 
static void finalize ()
 Static finalizer that is called during game shutdown.
 
local finalize ()
 Static finalizer that is called during game shutdown.
 

Additional Inherited Members

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

Detailed Description

Member Function Documentation

MaterialType getMaterialType ( ) const
inline

Get material type.

Returns
Material type
var getMaterialType ( )
inline

Get material type.

Returns
Material type
local getMaterialType ( )
inline

Get material type.

Returns
Material type
static Sprite3DMaterial*
createBuiltInMaterial
( MaterialType  type,
bool  skinned 
)
static

Create built in material from material type.

Parameters
typeMaterial type
skinnedHas skin?
Returns
Created material
var createBuiltInMaterial ( var  type,
var  skinned 
)
static

Create built in material from material type.

Parameters
typeMaterial type
skinnedHas skin?
Returns
Created material
local createBuiltInMaterial ( local  type,
local  skinned 
)
static

Create built in material from material type.

Parameters
typeMaterial type
skinnedHas skin?
Returns
Created material
static Sprite3DMaterial*
createWithFilename
( const std::string &  path)
static

Create material with file name, it creates material from cache if it is previously loaded.

Parameters
pathPath of material file
Returns
Created material
var createWithFilename ( var  path)
static

Create material with file name, it creates material from cache if it is previously loaded.

Parameters
pathPath of material file
Returns
Created material
local createWithFilename ( local  path)
static

Create material with file name, it creates material from cache if it is previously loaded.

Parameters
pathPath of material file
Returns
Created material
static Sprite3DMaterial*
createWithGLStateProgram
( GLProgramState programState)
static

Create material with GLProgramState.

Parameters
programStateGLProgramState instance
Returns
Created material
var createWithGLStateProgram ( var  programState)
static

Create material with GLProgramState.

Parameters
programStateGLProgramState instance
Returns
Created material
local createWithGLStateProgram ( local  programState)
static

Create material with GLProgramState.

Parameters
programStateGLProgramState instance
Returns
Created material

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