Cocos2d-x
4.0.0
|
Sprite3DMaterial: Material for Sprite3D. More...
Inherits Material.
Public Types | |
enum | MaterialType |
Material type, there are mainly two types of materials. More... | |
Public Member Functions | |
MaterialType | getMaterialType () const |
Get material type. | |
virtual Material * | clone () const override |
Clone material. | |
![]() | |
std::string | getName () const |
returns the material name | |
void | setName (const std::string &name) |
sets the material name | |
Technique * | getTechniqueByName (const std::string &name) |
Returns a Technique by its name. | |
Technique * | getTechniqueByIndex (ssize_t index) |
Returns a Technique by index. | |
Technique * | getTechnique () const |
Returns the Technique used by the Material. | |
const Vector< Technique * > & | getTechniques () const |
Returns the list of Techniques. | |
ssize_t | getTechniqueCount () const |
Returns the number of Techniques in the Material. | |
void | addTechnique (Technique *technique) |
Adds a Technique into the Material. | |
void | setTechnique (const std::string &techniqueName) |
Sets the current technique. | |
![]() | |
void | retain () |
Retains the ownership. | |
void | release () |
Releases the ownership immediately. | |
Ref * | autorelease () |
Releases the ownership sometime soon automatically. | |
unsigned int | getReferenceCount () const |
Returns the Ref's current reference count. | |
virtual | ~Ref () |
Destructor. | |
Static Public Member Functions | |
static Sprite3DMaterial * | createBuiltInMaterial (MaterialType type, bool skinned) |
Create built in material from material type. | |
static Sprite3DMaterial * | createWithFilename (const std::string &path) |
Create material with file name, it creates material from cache if it is previously loaded. | |
static Sprite3DMaterial * | createWithProgramState (backend::ProgramState *programState) |
Create material with GLProgramState. | |
static void | createBuiltInMaterial () |
Create all build in materials. | |
static void | releaseBuiltInMaterial () |
Release all built in materials. | |
static void | releaseCachedMaterial () |
Release all cached materials. | |
![]() | |
static Material * | createWithFilename (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). | |
static Material * | createWithProgramState (backend::ProgramState *programState) |
Creates a Material with a GLProgramState. | |
static Material * | createWithProperties (Properties *materialProperties) |
Creates a material from the specified properties object. | |
Additional Inherited Members | |
![]() | |
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. | |
Sprite3DMaterial: Material for Sprite3D.
enum MaterialType |
Material type, there are mainly two types of materials.
Built in materials and Custom material
|
inline |
Get material type.
|
static |
Create built in material from material type.
type | Material type |
skinned | Has skin? |
|
static |
Create material with file name, it creates material from cache if it is previously loaded.
path | Path of material file |
|
static |
Create material with GLProgramState.
programState | GLProgramState instance |