Package | starling.textures |
Class | public class TextureOptions |
Inheritance | TextureOptions Object |
Texture.fromData
and Texture.fromTextureBase
methods. Property | Defined 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 |
Method | Defined 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 |
forcePotTexture | property |
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
.
public function get forcePotTexture():Boolean
public function set forcePotTexture(value:Boolean):void
format | property |
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
.
public function get format():String
public function set format(value:String):void
mipMapping | property |
mipMapping:Boolean
Indicates if the texture contains mip maps.
The default value is false
.
public function get mipMapping():Boolean
public function set mipMapping(value:Boolean):void
onReady | property |
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
.
public function get onReady():Function
public function set onReady(value:Function):void
optimizeForRenderToTexture | property |
optimizeForRenderToTexture:Boolean
Indicates if the texture will be used as render target.
public function get optimizeForRenderToTexture():Boolean
public function set optimizeForRenderToTexture(value:Boolean):void
premultipliedAlpha | property |
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
.
public function get premultipliedAlpha():Boolean
public function set premultipliedAlpha(value:Boolean):void
scale | property |
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
.
public function get scale():Number
public function set scale(value:Number):void
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.
Parametersscale:Number (default = 1.0 )
| |
mipMapping:Boolean (default = false )
| |
format:String (default = bgra )
| |
premultipliedAlpha:Boolean (default = true )
| |
forcePotTexture:Boolean (default = false )
|
clone | () | method |
public function clone():TextureOptions
Creates a clone of the TextureOptions object with the exact same properties.
ReturnsTextureOptions |