Packageaway3d.materials
Classpublic class CompositeMaterial
ImplementsILayerMaterial, ITriangleMaterial, IUpdatingMaterial
SubclassesDot3BitmapMaterial, Dot3MovieMaterial, EnviroBitmapMaterial, PhongBitmapMaterial, PhongColorMaterial, PhongMovieMaterial

Container for layering multiple material objects. Renders each material by drawing one triangle per meterial layer. For static bitmap materials, use BitmapMaterialContainer.

See also

away3d.materials.BitmapMaterialContainer
Public Properties
 PropertyDefined by
  alpha : Number
Defines an alpha value for the layer container.
CompositeMaterial
  blendMode : String
Defines a blendMode value for the layer container.
CompositeMaterial
  color : uint
Defines a colored tint for the layer container.
CompositeMaterial
  materials : Array
An array of bitmapmaterial objects to be overlayed sequentially.
CompositeMaterial
  visible : Boolean
[read-only] Indicates whether the material is visible
CompositeMaterial
Protected Properties
 PropertyDefined by
  ini : Init
Instance of the Init object used to hold and parse default property values specified by the initialiser object in the 3d object constructor.
CompositeMaterial
Public Methods
 MethodDefined by
  
CompositeMaterial
(init:Object = null)
Creates a new CompositeMaterial object.
CompositeMaterial
  
renderLayer(tri:DrawTriangle, layer:Sprite, level:int):void
Renders a material layer for the specified triangle.
CompositeMaterial
  
Sends data from the material coupled with data from the DrawTriangle primitive to the render session.
CompositeMaterial
  
updateMaterial(source:Object3D, view:View3D):void
Called once per render loop when material is visible.
CompositeMaterial
Protected Methods
 MethodDefined by
  
Updates the colortransform object applied to the texture from the color and alpha properties.
CompositeMaterial
Property detail
alphaproperty
alpha:Number  [read-write]

Defines an alpha value for the layer container.

Implementation
    public function get alpha():Number
    public function set alpha(value:Number):void
blendModeproperty 
public var blendMode:String

Defines a blendMode value for the layer container.

colorproperty 
color:uint  [read-write]

Defines a colored tint for the layer container.

Implementation
    public function get color():uint
    public function set color(value:uint):void
iniproperty 
protected var ini:Init

Instance of the Init object used to hold and parse default property values specified by the initialiser object in the 3d object constructor.

materialsproperty 
public var materials:Array

An array of bitmapmaterial objects to be overlayed sequentially.

visibleproperty 
visible:Boolean  [read-only]

Indicates whether the material is visible

Implementation
    public function get visible():Boolean
Constructor detail
CompositeMaterial()constructor
public function CompositeMaterial(init:Object = null)Parameters
init:Object (default = null) — [optional] An initialisation object for specifying default instance properties.
####INIT####
Method detail
renderLayer()method
public function renderLayer(tri:DrawTriangle, layer:Sprite, level:int):void

Renders a material layer for the specified triangle.

Parameters
tri:DrawTriangle — The drawtriangle used for render information.
 
layer:Sprite — The parent layer into which the triangle is drawn.
 
level:int — Defines the sprite level for the layer.
renderTriangle()method 
public function renderTriangle(tri:DrawTriangle):void

Sends data from the material coupled with data from the DrawTriangle primitive to the render session.

Parameters
tri:DrawTriangle
setColorTransform()method 
protected function setColorTransform():void

Updates the colortransform object applied to the texture from the color and alpha properties.

See also

color
alpha
updateMaterial()method 
public function updateMaterial(source:Object3D, view:View3D):void

Called once per render loop when material is visible.

Parameters
source:Object3D
 
view:View3D
Wiki link
Click to go to the wiki page for ####WIKI####

Code examples

Comments