Static methods

@:value({ mipmaps : false, format : Context3DTextureFormat.BGRA })staticfromBitmapData(data:BitmapData, format:Context3DTextureFormat = Context3DTextureFormat.BGRA, mipmaps:Bool = false, ?params:{wrapMode:Null<FoxWrapMode>, mipFilter:Null<FoxMipFilter>, filter:Null<FoxTextureFilter>}):FoxTexture

@:value({ format : Context3DTextureFormat.BGRA, mipmaps : false })staticfromImage(name:String, mipmaps:Bool = false, format:Context3DTextureFormat = Context3DTextureFormat.BGRA, ?params:{wrapMode:Null<FoxWrapMode>, mipFilter:Null<FoxMipFilter>, filter:Null<FoxTextureFilter>}):FoxTexture

Loads a FoxTexture from an image located in images/ (with .png extension)

@:value({ format : Context3DTextureFormat.BGRA, mipmaps : false })staticfromImageRaw(name:String, mipmaps:Bool = false, format:Context3DTextureFormat = Context3DTextureFormat.BGRA, ?params:{wrapMode:Null<FoxWrapMode>, mipFilter:Null<FoxMipFilter>, filter:Null<FoxTextureFilter>}):FoxTexture

Loads a FoxTexture using a full raw asset path (including extension)

@:value({ type : "unsigned_byte", format : "rgba" })staticcreate(width:Int, height:Int, format:String = "rgba", type:String = "unsigned_byte"):FoxTexture

Creates a texture on the GPU, this texture can be used as a render target.

For a friendly list of available formats, check MDN's texImage2D() types.

It applies for standard OpenGL aswell, with the exception of WEBGL_.

staticwrap(bitmap:BitmapData):FoxTexture

Lighter version of fromBitmapData()

Note: Use this if the bitmap data already has a GPU texture attached to it.

staticwrapGL(glTexture:TextureBase):FoxTexture

Constructor

@:value({ mipFilter : FoxMipFilter.MIPNONE, filter : FoxTextureFilter.LINEAR, wrapMode : FoxWrapMode.CLAMP })new(wrapMode:FoxWrapMode = FoxWrapMode.CLAMP, filter:FoxTextureFilter = FoxTextureFilter.LINEAR, mipFilter:FoxMipFilter = FoxMipFilter.MIPNONE)

Variables

@:value(null)context:Context3D = null

glTexture:TextureBase

assetsKey:String

width:Int

height:Int

private@:value(null)__format:String = null

private@:value(null)__type:String = null

Methods

privateget_width():Int

privateget_height():Int

asBitmapData():BitmapData

resize(width:Int, height:Int):FoxTexture

Resizes this texture. Intended for framebuffer textures,

Note: This will not work with textures that have been wrapped/loaded from a file.

take(bitmap:BitmapData):Void

Instance version of FoxTexture.wrap()

Takes a BitmapData and sets it as the GPU texture

Note: This will not update any extra information of this texture, such as format or type.

takeGL(texture:TextureBase):Void

Instance version of FoxTexture.wrapGL()

Takes a Texture and sets it as the GPU texture

Note: This will not update any extra information of this texture, such as format or type.

destroy():Void