Packagestarling.textures
Classpublic class SubTexture
InheritanceSubTexture Inheritance Texture Inheritance Object

A SubTexture represents a section of another texture. This is achieved solely by manipulation of texture coordinates, making the class very efficient.

Note that it is OK to create subtextures of subtextures.



Public Properties
 PropertyDefined By
  base : TextureBase
[override] [read-only] The Stage3D texture object the texture is based on.
SubTexture
  clipping : Rectangle
[read-only] The clipping rectangle, which is the region provided on initialization scaled into [0.0, 1.0].
SubTexture
 Inheritedframe : Rectangle
[read-only] The texture frame (see class description).
Texture
  height : Number
[override] [read-only] The height of the texture in pixels.
SubTexture
  mipMapping : Boolean
[override] [read-only] Indicates if the texture contains mip maps.
SubTexture
  ownsParent : Boolean
[read-only] Indicates if the parent texture is disposed when this object is disposed.
SubTexture
  parent : Texture
[read-only] The texture which the subtexture is based on.
SubTexture
  premultipliedAlpha : Boolean
[override] [read-only] Indicates if the alpha values are premultiplied into the RGB values.
SubTexture
 Inheritedrepeat : Boolean
Indicates if the texture should repeat like a wallpaper or stretch the outermost pixels.
Texture
  scale : Number
[override] [read-only] The scale factor, which influences width and height properties.
SubTexture
  width : Number
[override] [read-only] The width of the texture in pixels.
SubTexture
Public Methods
 MethodDefined By
  
SubTexture(parentTexture:Texture, region:Rectangle, ownsParent:Boolean = false)
Creates a new subtexture containing the specified region (in points) of a parent texture.
SubTexture
  
adjustVertexData(vertexData:VertexData, vertexID:int, count:int):void
[override] Converts texture coordinates and vertex positions of raw vertex data into the format required for rendering.
SubTexture
  
dispose():void
[override] Disposes the parent texture if this texture owns it.
SubTexture
 Inherited
empty(width:int = 64, height:int = 64, color:uint = 0xffffffff, optimizeForRenderTexture:Boolean = false, scale:Number = -1):Texture
[static] Creates an empty texture of a certain size and color.
Texture
 Inherited
fromAtfData(data:ByteArray, scale:Number = 1):Texture
[static] Creates a texture from the compressed ATF format.
Texture
 Inherited
fromBitmap(data:Bitmap, generateMipMaps:Boolean = true, optimizeForRenderTexture:Boolean = false, scale:Number = 1):Texture
[static] Creates a texture object from a bitmap.
Texture
 Inherited
fromBitmapData(data:BitmapData, generateMipMaps:Boolean = true, optimizeForRenderTexture:Boolean = false, scale:Number = 1):Texture
[static] Creates a texture from bitmap data.
Texture
 Inherited
fromTexture(texture:Texture, region:Rectangle = null, frame:Rectangle = null):Texture
[static] Creates a texture that contains a region (in pixels) of another texture.
Texture
 Inherited
uploadAtfData(nativeTexture:Texture, data:ByteArray, offset:int = 0):void
[static] Uploads ATF data from a ByteArray to a native texture.
Texture
 Inherited
uploadBitmapData(nativeTexture:Texture, data:BitmapData, generateMipmaps:Boolean):void
[static] Uploads the bitmap data to the native texture, optionally creating mipmaps.
Texture
Property Detail
baseproperty
base:TextureBase  [read-only] [override]

The Stage3D texture object the texture is based on.


Implementation
    public function get base():TextureBase
clippingproperty 
clipping:Rectangle  [read-only]

The clipping rectangle, which is the region provided on initialization scaled into [0.0, 1.0].


Implementation
    public function get clipping():Rectangle
heightproperty 
height:Number  [read-only] [override]

The height of the texture in pixels.


Implementation
    public function get height():Number
mipMappingproperty 
mipMapping:Boolean  [read-only] [override]

Indicates if the texture contains mip maps.


Implementation
    public function get mipMapping():Boolean
ownsParentproperty 
ownsParent:Boolean  [read-only]

Indicates if the parent texture is disposed when this object is disposed.


Implementation
    public function get ownsParent():Boolean
parentproperty 
parent:Texture  [read-only]

The texture which the subtexture is based on.


Implementation
    public function get parent():Texture
premultipliedAlphaproperty 
premultipliedAlpha:Boolean  [read-only] [override]

Indicates if the alpha values are premultiplied into the RGB values.


Implementation
    public function get premultipliedAlpha():Boolean
scaleproperty 
scale:Number  [read-only] [override]

The scale factor, which influences width and height properties.


Implementation
    public function get scale():Number
widthproperty 
width:Number  [read-only] [override]

The width of the texture in pixels.


Implementation
    public function get width():Number
Constructor Detail
SubTexture()Constructor
public function SubTexture(parentTexture:Texture, region:Rectangle, ownsParent:Boolean = false)

Creates a new subtexture containing the specified region (in points) of a parent texture. If 'ownsParent' is true, the parent texture will be disposed automatically when the subtexture is disposed.

Parameters
parentTexture:Texture
 
region:Rectangle
 
ownsParent:Boolean (default = false)
Method Detail
adjustVertexData()method
override public function adjustVertexData(vertexData:VertexData, vertexID:int, count:int):void

Converts texture coordinates and vertex positions of raw vertex data into the format required for rendering.

Parameters

vertexData:VertexData
 
vertexID:int
 
count:int

dispose()method 
override public function dispose():void

Disposes the parent texture if this texture owns it.