Packagestarling.textures
Classpublic class TextureOptions
InheritanceTextureOptions Inheritance Object

The TextureOptions class specifies options for loading textures with the Texture.fromData and Texture.fromTextureBase methods.



Public Properties
 PropertyDefined By
  forcePotTexture : Boolean
Indicates if the underlying Stage3D texture should be created as the power-of-two based Texture class instead of the more memory efficient RectangleTexture.
TextureOptions
  format : String
The Context3DTextureFormat of the underlying texture data.
TextureOptions
  mipMapping : Boolean
Indicates if the texture contains mip maps.
TextureOptions
  onReady : Function
A callback that is used only for ATF textures; if it is set, the ATF data will be decoded asynchronously.
TextureOptions
  optimizeForRenderToTexture : Boolean
Indicates if the texture will be used as render target.
TextureOptions
  premultipliedAlpha : Boolean
Indicates if the alpha values are premultiplied into the RGB values.
TextureOptions
  scale : Number
The scale factor, which influences width and height properties.
TextureOptions
Public Methods
 MethodDefined By
  
TextureOptions(scale:Number = 1.0, mipMapping:Boolean = false, format:String = bgra, premultipliedAlpha:Boolean = true, forcePotTexture:Boolean = false)
Creates a new instance with the given options.
TextureOptions
  
Creates a clone of the TextureOptions object with the exact same properties.
TextureOptions
Property Detail
forcePotTextureproperty
forcePotTexture:Boolean

Indicates if the underlying Stage3D texture should be created as the power-of-two based Texture class instead of the more memory efficient RectangleTexture. That might be useful when you need to render the texture with wrap mode repeat.

The default value is false.


Implementation
    public function get forcePotTexture():Boolean
    public function set forcePotTexture(value:Boolean):void
formatproperty 
format:String

The Context3DTextureFormat of the underlying texture data. Only used for textures that are created from Bitmaps; the format of ATF files is set when they are created.

The default value is BGRA.


Implementation
    public function get format():String
    public function set format(value:String):void
mipMappingproperty 
mipMapping:Boolean

Indicates if the texture contains mip maps.

The default value is false.


Implementation
    public function get mipMapping():Boolean
    public function set mipMapping(value:Boolean):void
onReadyproperty 
onReady:Function

A callback that is used only for ATF textures; if it is set, the ATF data will be decoded asynchronously. The texture can only be used when the callback has been executed. This property is ignored for all other texture types (they are ready immediately when the 'Texture.from...' method returns, anyway), and it's only used by the Texture.fromData factory method.

This is the expected function definition: function(texture:Texture):void;

The default value is null.


Implementation
    public function get onReady():Function
    public function set onReady(value:Function):void
optimizeForRenderToTextureproperty 
optimizeForRenderToTexture:Boolean

Indicates if the texture will be used as render target.


Implementation
    public function get optimizeForRenderToTexture():Boolean
    public function set optimizeForRenderToTexture(value:Boolean):void
premultipliedAlphaproperty 
premultipliedAlpha:Boolean

Indicates if the alpha values are premultiplied into the RGB values. This is typically true for textures created from BitmapData and false for textures created from ATF data. This property will only be read by the Texture.fromTextureBase factory method.

The default value is true.


Implementation
    public function get premultipliedAlpha():Boolean
    public function set premultipliedAlpha(value:Boolean):void
scaleproperty 
scale:Number

The scale factor, which influences width and height properties. If you pass '-1', the current global content scale factor will be used.

The default value is 1.0.


Implementation
    public function get scale():Number
    public function set scale(value:Number):void
Constructor Detail
TextureOptions()Constructor
public function TextureOptions(scale:Number = 1.0, mipMapping:Boolean = false, format:String = bgra, premultipliedAlpha:Boolean = true, forcePotTexture:Boolean = false)

Creates a new instance with the given options.

Parameters
scale:Number (default = 1.0)
 
mipMapping:Boolean (default = false)
 
format:String (default = bgra)
 
premultipliedAlpha:Boolean (default = true)
 
forcePotTexture:Boolean (default = false)
Method Detail
clone()method
public function clone():TextureOptions

Creates a clone of the TextureOptions object with the exact same properties.

Returns
TextureOptions