| Package | sandy.materials |
| Class | public class BitmapMaterial |
| Inheritance | BitmapMaterial Material |
| Implements | IAlphaMaterial |
| Subclasses | MovieMaterial, VideoMaterial |
| Property | Defined by | ||
|---|---|---|---|
| alpha : Number
Indicates the alpha transparency value of the material.
| BitmapMaterial | ||
![]() | attributes : MaterialAttributes
The attributes of this material.
| Material | |
![]() | filters : Array
The array of filters for this material.
| Material | |
![]() | flags : uint
Contains specific material flags.
| Material | |
![]() | id : Number
The unique id of this material.
| Material | |
![]() | lightingEnable : Boolean = false
Specifies if the material can receive light and have light attributes applied to it.
| Material | |
| maxRecurssionDepth : uint = 5
Maximum recurssion depth when using precision > 1 (which enables the perspective correction).
| BitmapMaterial | ||
![]() | modified : Boolean
The modified state of this material.
| Material | |
| precision : uint = 0
Precision of the bitmap mapping.
| BitmapMaterial | ||
![]() | repeat : Boolean = true
The repeat property.
| Material | |
| smooth : Boolean = false
This property enables smooth bitmap rendering when set to true.
| BitmapMaterial | ||
| texture : BitmapData
The texture ( bitmap ) of this material.
| BitmapMaterial | ||
![]() | type : MaterialType
The material type of this material.
| Material | |
![]() | useVertexNormal : Boolean = false
Specify if the material use the vertex normal information.
| Material | |
| Method | Defined by | ||
|---|---|---|---|
|
BitmapMaterial(p_oTexture:BitmapData = null, p_oAttr:MaterialAttributes = null, p_nPrecision:uint = 0)
Creates a new BitmapMaterial.
| BitmapMaterial | ||
![]() |
Calls begin method of the MaterialAttributes associated with this material.
| Material | |
![]() |
Calls finish method of the MaterialAttributes associated with this material.
| Material | |
|
| BitmapMaterial | ||
![]() |
Renders the polygon dress in this material.
| Material | |
![]() |
Renders the sprite dress in this material.
| Material | |
|
setTiling(p_nW:Number, p_nH:Number, p_nU:Number = 0, p_nV:Number = 0):void
Sets texture tiling and optional offset.
| BitmapMaterial | ||
|
setTransparency(p_nValue:Number):void
Changes the transparency of the texture.
| BitmapMaterial | ||
|
toString():String
Returns a string representation of this object.
| BitmapMaterial | ||
![]() |
Calls unlink method of the MaterialAttributes associated with this material.
| Material | |
| alpha | property |
alpha:Number [read-write]Indicates the alpha transparency value of the material. Valid values are 0 (fully transparent) to 1 (fully opaque).
The default value is 1.0.
public function get alpha():Number
public function set alpha(value:Number):void
| maxRecurssionDepth | property |
public var maxRecurssionDepth:uint = 5Maximum recurssion depth when using precision > 1 (which enables the perspective correction). The bigger the number is, the more accurate the result will be. Try to change this value to fits your needs to obtain the best performance.
| precision | property |
public var precision:uint = 0Precision of the bitmap mapping. This material uses an affine linear mapping. It results in a lack of accuracy at rendering time when the surface to draw is too big. An usual solution is to augment the number of polygon, but the performance cost can be quite big. An other solution is to change this property value. The lower to more accurate the perspective correction is. To disable the perspective correction, set this property to zero, which is also the default value If you use the precision to solve the distortion issue, you can reduce the primitives quality (execpt if you are experimenting some sorting issues)
| smooth | property |
public var smooth:Boolean = falseThis property enables smooth bitmap rendering when set to true. The default value is set to false to have the best performance first. Enable this property have a performance impact, use it warefully
| texture | property |
texture:BitmapData [read-write]The texture ( bitmap ) of this material.
Implementation public function get texture():BitmapData
public function set texture(value:BitmapData):void
| BitmapMaterial | () | constructor |
public function BitmapMaterial(p_oTexture:BitmapData = null, p_oAttr:MaterialAttributes = null, p_nPrecision:uint = 0)Creates a new BitmapMaterial.
Please note that we ue internally a copy of the constructor bitmapdata. Thatea mns in case you need to access this bitmapdata, you can't just use the same reference but you shall use the BitmapMaterial#texture getter property to make it work.
Parametersp_oTexture:BitmapData (default = null) — The bitmapdata for this material.
|
|
p_oAttr:MaterialAttributes (default = null) — The attributes for this material.
|
|
p_nPrecision:uint (default = 0) — The precision of this material. Using a precision with 0 makes the material behave as before. Then 1 as precision is very high and requires a lot of computation but proceed a the best perpective mapping correction. Bigger values are less CPU intensive but also less accurate. Usually a value of 5 is enough.
|
See also
| init | () | method |
public override function init(p_oPolygon:Polygon):voidParameters
p_oPolygon:Polygon — The face dressed by this material
|
| setTiling | () | method |
public function setTiling(p_nW:Number, p_nH:Number, p_nU:Number = 0, p_nV:Number = 0):voidSets texture tiling and optional offset. Tiling is applied first.
Parametersp_nW:Number |
|
p_nH:Number |
|
p_nU:Number (default = 0) |
|
p_nV:Number (default = 0) |
| setTransparency | () | method |
public function setTransparency(p_nValue:Number):voidChanges the transparency of the texture.
The passed value is the percentage of opacity.
Parametersp_nValue:Number — A value between 0 and 1. (automatically constrained)
|
| toString | () | method |
public function toString():StringReturns a string representation of this object.
ReturnsString — The fully qualified name of this object.
|