Package | starling.textures |
Class | public class ConcreteTexture |
Inheritance | ConcreteTexture Texture Object |
Property | Defined By | ||
---|---|---|---|
base : TextureBase [override] [read-only] The Stage3D texture object the texture is based on. | ConcreteTexture | ||
format : String [override] [read-only] The Context3DTextureFormat of the underlying texture data. | ConcreteTexture | ||
frame : Rectangle [read-only] The texture frame if it has one (see class description), otherwise null. | Texture | ||
height : Number [override] [read-only] The height of the texture in points. | ConcreteTexture | ||
maxSize : int [static] [read-only] Returns the maximum size constraint (for both width and height) for textures in the
current Context3D profile. | Texture | ||
mipMapping : Boolean [override] [read-only] Indicates if the texture contains mip maps. | ConcreteTexture | ||
nativeHeight : Number [override] [read-only] The height of the texture in pixels (without scale adjustment). | ConcreteTexture | ||
nativeWidth : Number [override] [read-only] The width of the texture in pixels (without scale adjustment). | ConcreteTexture | ||
onRestore : Function If Starling's "handleLostContext" setting is enabled, the function that you provide
here will be called after a context loss. | ConcreteTexture | ||
optimizedForRenderTexture : Boolean [read-only] Indicates if the base texture was optimized for being used in a render texture. | ConcreteTexture | ||
premultipliedAlpha : Boolean [override] [read-only] Indicates if the alpha values are premultiplied into the RGB values. | ConcreteTexture | ||
repeat : Boolean [override] [read-only] Indicates if the texture should repeat like a wallpaper or stretch the outermost pixels. | ConcreteTexture | ||
root : ConcreteTexture [override] [read-only] The concrete texture the texture is based on. | ConcreteTexture | ||
scale : Number [override] [read-only] The scale factor, which influences width and height properties. | ConcreteTexture | ||
width : Number [override] [read-only] The width of the texture in points. | ConcreteTexture |
Method | Defined By | ||
---|---|---|---|
ConcreteTexture(base:TextureBase, format:String, width:int, height:int, mipMapping:Boolean, premultipliedAlpha:Boolean, optimizedForRenderTexture:Boolean = false, scale:Number = 1, repeat:Boolean = false) Creates a ConcreteTexture object from a TextureBase, storing information about size,
mip-mapping, and if the channels contain premultiplied alpha values. | ConcreteTexture | ||
adjustTexCoords(texCoords:Vector.<Number>, startIndex:int = 0, stride:int = 0, count:int = -1):void Converts texture coordinates into the format required for rendering. | Texture | ||
adjustVertexData(vertexData:VertexData, vertexID:int, count:int):void Converts texture coordinates and vertex positions of raw vertex data into the format
required for rendering. | Texture | ||
attachCamera(camera:Camera, onComplete:Function = null):void | ConcreteTexture | ||
attachNetStream(netStream:NetStream, onComplete:Function = null):void | ConcreteTexture | ||
attachVideo(type:String, attachment:Object, onComplete:Function = null):void | ConcreteTexture | ||
clear(color:uint = 0x0, alpha:Number = 0.0):void Clears the texture with a certain color and alpha value. | ConcreteTexture | ||
dispose():void [override] Disposes the TextureBase object. | ConcreteTexture | ||
empty(width:Number, height:Number, premultipliedAlpha:Boolean = true, mipMapping:Boolean = true, optimizeForRenderToTexture:Boolean = false, scale:Number = -1, format:String = bgra, repeat:Boolean = false):Texture [static] Creates an empty texture of a certain size. | Texture | ||
fromAtfData(data:ByteArray, scale:Number = 1, useMipMaps:Boolean = true, async:Function = null, repeat:Boolean = false):Texture [static] Creates a texture from the compressed ATF format. | Texture | ||
fromBitmap(bitmap:Bitmap, generateMipMaps:Boolean = true, optimizeForRenderToTexture:Boolean = false, scale:Number = 1, format:String = bgra, repeat:Boolean = false):Texture [static] Creates a texture object from a bitmap. | Texture | ||
fromBitmapData(data:BitmapData, generateMipMaps:Boolean = true, optimizeForRenderToTexture:Boolean = false, scale:Number = 1, format:String = bgra, repeat:Boolean = false):Texture [static] Creates a texture object from bitmap data. | Texture | ||
fromCamera(camera:Camera, scale:Number = 1, onComplete:Function = null):Texture [static] Creates a video texture from a camera. | Texture | ||
fromColor(width:Number, height:Number, color:uint = 0xffffffff, optimizeForRenderToTexture:Boolean = false, scale:Number = -1, format:String = bgra):Texture [static] Creates a texture with a certain size and color. | Texture | ||
[static] Creates a texture object from any of the supported data types, using the specified
options. | Texture | ||
fromEmbeddedAsset(assetClass:Class, mipMapping:Boolean = true, optimizeForRenderToTexture:Boolean = false, scale:Number = 1, format:String = bgra, repeat:Boolean = false):Texture [static] Creates a texture object from an embedded asset class. | Texture | ||
fromNetStream(stream:NetStream, scale:Number = 1, onComplete:Function = null):Texture [static] Creates a video texture from a NetStream. | Texture | ||
fromTexture(texture:Texture, region:Rectangle = null, frame:Rectangle = null, rotated:Boolean = false):Texture [static] Creates a texture that contains a region (in pixels) of another texture. | Texture | ||
uploadAtfData(data:ByteArray, offset:int = 0, async:* = null):void Uploads ATF data from a ByteArray to the texture. | ConcreteTexture | ||
uploadBitmap(bitmap:Bitmap):void Uploads a bitmap to the texture. | ConcreteTexture | ||
uploadBitmapData(data:BitmapData):void Uploads bitmap data to the texture. | ConcreteTexture |
base | property |
base:TextureBase
[read-only] [override] The Stage3D texture object the texture is based on.
public function get base():TextureBase
format | property |
format:String
[read-only] [override] The Context3DTextureFormat
of the underlying texture data.
public function get format():String
height | property |
height:Number
[read-only] [override] The height of the texture in points.
public function get height():Number
mipMapping | property |
mipMapping:Boolean
[read-only] [override] Indicates if the texture contains mip maps.
public function get mipMapping():Boolean
nativeHeight | property |
nativeHeight:Number
[read-only] [override] The height of the texture in pixels (without scale adjustment).
public function get nativeHeight():Number
nativeWidth | property |
nativeWidth:Number
[read-only] [override] The width of the texture in pixels (without scale adjustment).
public function get nativeWidth():Number
onRestore | property |
onRestore:Function
If Starling's "handleLostContext" setting is enabled, the function that you provide here will be called after a context loss. On execution, a new base texture will already have been created; however, it will be empty. Call one of the "upload..." methods from within the callbacks to restore the actual texture data.
public function get onRestore():Function
public function set onRestore(value:Function):void
optimizedForRenderTexture | property |
optimizedForRenderTexture:Boolean
[read-only] Indicates if the base texture was optimized for being used in a render texture.
public function get optimizedForRenderTexture():Boolean
premultipliedAlpha | property |
premultipliedAlpha:Boolean
[read-only] [override] Indicates if the alpha values are premultiplied into the RGB values.
public function get premultipliedAlpha():Boolean
repeat | property |
repeat:Boolean
[read-only] [override] Indicates if the texture should repeat like a wallpaper or stretch the outermost pixels. Note: this only works in textures with sidelengths that are powers of two and that are not loaded from a texture atlas (i.e. no subtextures).
public function get repeat():Boolean
root | property |
root:ConcreteTexture
[read-only] [override] The concrete texture the texture is based on.
public function get root():ConcreteTexture
scale | property |
scale:Number
[read-only] [override] The scale factor, which influences width and height properties.
public function get scale():Number
width | property |
width:Number
[read-only] [override] The width of the texture in points.
public function get width():Number
ConcreteTexture | () | Constructor |
public function ConcreteTexture(base:TextureBase, format:String, width:int, height:int, mipMapping:Boolean, premultipliedAlpha:Boolean, optimizedForRenderTexture:Boolean = false, scale:Number = 1, repeat:Boolean = false)
Creates a ConcreteTexture object from a TextureBase, storing information about size, mip-mapping, and if the channels contain premultiplied alpha values.
Parametersbase:TextureBase | |
format:String | |
width:int | |
height:int | |
mipMapping:Boolean | |
premultipliedAlpha:Boolean | |
optimizedForRenderTexture:Boolean (default = false )
| |
scale:Number (default = 1 )
| |
repeat:Boolean (default = false )
|
attachCamera | () | method |
public function attachCamera(camera:Camera, onComplete:Function = null):void
Parameters
camera:Camera | |
onComplete:Function (default = null )
|
attachNetStream | () | method |
public function attachNetStream(netStream:NetStream, onComplete:Function = null):void
Parameters
netStream:NetStream | |
onComplete:Function (default = null )
|
attachVideo | () | method |
public function attachVideo(type:String, attachment:Object, onComplete:Function = null):void
Parameters
type:String | |
attachment:Object | |
onComplete:Function (default = null )
|
clear | () | method |
public function clear(color:uint = 0x0, alpha:Number = 0.0):void
Clears the texture with a certain color and alpha value. The previous contents of the texture is wiped out. Beware: this method resets the render target to the back buffer; don't call it from within a render method.
Parameters
color:uint (default = 0x0 )
| |
alpha:Number (default = 0.0 )
|
createBase | () | method |
starling_internal function createBase():void
Recreates the underlying Stage3D texture object with the same dimensions and attributes as the one that was passed to the constructor. You have to upload new data before the texture becomes usable again. Beware: this method does not dispose the current base.
dispose | () | method |
override public function dispose():void
Disposes the TextureBase object.
uploadAtfData | () | method |
public function uploadAtfData(data:ByteArray, offset:int = 0, async:* = null):void
Uploads ATF data from a ByteArray to the texture. Note that the size of the ATF-encoded data must be exactly the same as the original texture size.
The 'async' parameter may be either a boolean value or a callback function.
If it's false
or null
, the texture will be decoded
synchronously and will be visible right away. If it's true
or a function,
the data will be decoded asynchronously. The texture will remain unchanged until the
upload is complete, at which time the callback function will be executed. This is the
expected function definition: function(texture:Texture):void;
Parameters
data:ByteArray | |
offset:int (default = 0 )
| |
async:* (default = null )
|
uploadBitmap | () | method |
public function uploadBitmap(bitmap:Bitmap):void
Uploads a bitmap to the texture. The existing contents will be replaced. If the size of the bitmap does not match the size of the texture, the bitmap will be cropped or filled up with transparent pixels
Parameters
bitmap:Bitmap |
uploadBitmapData | () | method |
public function uploadBitmapData(data:BitmapData):void
Uploads bitmap data to the texture. The existing contents will be replaced. If the size of the bitmap does not match the size of the texture, the bitmap will be cropped or filled up with transparent pixels
Parameters
data:BitmapData |