The MaterialLibrary singleton class provides a central access and management point for any materials in existence.
public static function getInstance():MaterialLibrary
Retrieves the singleton MaterialLibrary instance.
Returns
public function getMaterial(name:String, materialNamespace:String = null):MaterialBase
Retrieves the material with the given name and namespace.
Parameters
| name:String — The name of the material to retrieve.
|
|
| materialNamespace:String (default = null ) — An optional namespace to which the material belongs.
|
Returns
| MaterialBase —
The material corresponding to the name an namespace
|
public function getMaterialById(id:int):MaterialBase
Retrieves the material with the given id.
Parameters
Returns
public function setMaterial(name:String, material:MaterialBase, materialNamespace:String = null):void
Replaces a material with a given name and namespace with a new material.
Parameters
| name:String — The name of the material to change.
|
|
| material:MaterialBase — The new material to assign.
|
|
| materialNamespace:String (default = null ) — An optional namespace to which the material belongs.
|