Package | starling.textures |
Class | public class SubTexture |
Inheritance | SubTexture ![]() ![]() |
Note that it is OK to create subtextures of subtextures.
Property | Defined 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 | ||
format : String [override] [read-only] The Context3DTextureFormat of the underlying texture data. | SubTexture | ||
![]() | frame : Rectangle [read-only] The texture frame (see class description). | Texture | |
height : Number [override] [read-only] The height of the texture in points. | SubTexture | ||
mipMapping : Boolean [override] [read-only] Indicates if the texture contains mip maps. | SubTexture | ||
nativeHeight : Number [override] [read-only] The height of the texture in pixels (without scale adjustment). | SubTexture | ||
nativeWidth : Number [override] [read-only] The width of the texture in pixels (without scale adjustment). | 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 | ||
![]() | repeat : Boolean Indicates if the texture should repeat like a wallpaper or stretch the outermost pixels. | Texture | |
root : ConcreteTexture [override] [read-only] The concrete (power-of-two) texture the texture is based on. | SubTexture | ||
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 points. | SubTexture |
Method | Defined 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 | ||
![]() | empty(width:int = 64, height:int = 64, premultipliedAlpha:Boolean = false, optimizeForRenderToTexture:Boolean = true, scale:Number = -1):Texture [static] Creates an empty texture of a certain size. | Texture | |
![]() | fromAtfData(data:ByteArray, scale:Number = 1, useMipMaps:Boolean = true, loadAsync:Function = null):Texture [static] Creates a texture from the compressed ATF format. | Texture | |
![]() | fromBitmap(data:Bitmap, generateMipMaps:Boolean = true, optimizeForRenderToTexture:Boolean = false, scale:Number = 1):Texture [static] Creates a texture object from a bitmap. | Texture | |
![]() | fromBitmapData(data:BitmapData, generateMipMaps:Boolean = true, optimizeForRenderToTexture:Boolean = false, scale:Number = 1):Texture [static] Creates a texture from bitmap data. | Texture | |
![]() | fromColor(width:int, height:int, color:uint = 0xffffffff, optimizeForRenderToTexture:Boolean = false, scale:Number = -1):Texture [static] Creates a texture with a certain size and color. | Texture | |
![]() | [static] Creates a texture that contains a region (in pixels) of another texture. | Texture |
base | property |
base:TextureBase
[read-only] [override] The Stage3D texture object the texture is based on.
public function get base():TextureBase
clipping | property |
clipping:Rectangle
[read-only] The clipping rectangle, which is the region provided on initialization scaled into [0.0, 1.0].
public function get clipping():Rectangle
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
ownsParent | property |
ownsParent:Boolean
[read-only] Indicates if the parent texture is disposed when this object is disposed.
public function get ownsParent():Boolean
parent | property |
parent:Texture
[read-only] The texture which the subtexture is based on.
public function get parent():Texture
premultipliedAlpha | property |
premultipliedAlpha:Boolean
[read-only] [override] Indicates if the alpha values are premultiplied into the RGB values.
public function get premultipliedAlpha():Boolean
root | property |
root:ConcreteTexture
[read-only] [override] The concrete (power-of-two) 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
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.
ParametersparentTexture:Texture | |
region:Rectangle | |
ownsParent:Boolean (default = false )
|
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.