Packageaway3d.materials
Classpublic class MaterialLibrary

The MaterialLibrary singleton class provides a central access and management point for any materials in existence.

Public Methods
 MethodDefined by
  
[static] Retrieves the singleton MaterialLibrary instance.
MaterialLibrary
  
getMaterial(name:String, materialNamespace:String = null):MaterialBase
Retrieves the material with the given name and namespace.
MaterialLibrary
  
Retrieves the material with the given id.
MaterialLibrary
  
setMaterial(name:String, material:MaterialBase, materialNamespace:String = null):void
Replaces a material with a given name and namespace with a new material.
MaterialLibrary
Method detail
getInstance()method
public static function getInstance():MaterialLibrary

Retrieves the singleton MaterialLibrary instance.

Returns
MaterialLibrary
getMaterial()method 
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
getMaterialById()method 
public function getMaterialById(id:int):MaterialBase

Retrieves the material with the given id.

Parameters
id:int

Returns
MaterialBase
setMaterial()method 
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.
Wiki link
Click to go to the wiki page for 'away3d.materials.MaterialLibrary'

Code examples

Comments