Package | flash.display3D |
Class | public final class Context3DTextureFormat |
Inheritance | Context3DTextureFormat Object |
Language Version: | ActionScript 3.0 |
Runtime Versions: | Flash Player 11, AIR 3 |
Use the constants defined in this class when calling the createTexture()
and
createCubeTexture()
methods of the Context3D class.
Related API Elements
Public Properties
Public Methods
Public Constants
Constant | Defined By | ||
---|---|---|---|
BGRA : String = "bgra" [static]
A texture with colors defined with 8-bit color components in the order: blue, green, red, alpha. | Context3DTextureFormat | ||
COMPRESSED : String = "compressed" [static]
A texture in the Adobe Texture Format. | Context3DTextureFormat |
Constant Detail
BGRA | Constant |
public static const BGRA:String = "bgra"
Language Version: | ActionScript 3.0 |
Runtime Versions: | Flash Player 11, AIR 3 |
A texture with colors defined with 8-bit color components in the order: blue, green, red, alpha.
The BGRA format is the internal format used by Flash bitmaps. Use this format when using a BitmapData object as a texture. You can create a ByteArray containing a texture in BGRA format by writing the desired color values in the correct order (no header informtion is used).
Example ( How to use this example )
The following example creates a byte array containing a blue and green colored
texture. When used as a 64x64 pixel texture, the result is blue and green stripes. (The
texture information in the byte array does not specify width or height. These values are
specified when you call the Context3D
createTexture()
method.)
private function generateTexture():ByteArray { var texture:ByteArray = new ByteArray(); var blue:uint = 0x00ff00ff; var green:uint = 0xff0000ff; var band:int = 8; for( var i:int = 0; i < 64*64; i++ ) { if( ( i % (band * 2) ) < band ) { texture.writeUnsignedInt( blue ); } else { texture.writeUnsignedInt( green ); } } return texture; } }
COMPRESSED | Constant |
public static const COMPRESSED:String = "compressed"
Language Version: | ActionScript 3.0 |
Runtime Versions: | Flash Player 11, AIR 3 |
A texture in the Adobe Texture Format.
Mon Nov 28 2011, 06:48 AM -08:00