Constructor

@:value({ antialiasing : 0, stencil : true, depth : true, density : -1 })new(width:Float, height:Float, density:Float = -1, depth:Bool = true, stencil:Bool = true, antialiasing:Int = 0)

Variables

@:value(true)autoRender:Bool = true

@:value(true)clearOnRender:Bool = true

@:value(false)renderDirty:Bool = false

@:value(true)read onlydepth:Bool = true

@:value(true)read onlystencil:Bool = true

@:value(0)read onlyantialiasing:Int = 0

@:value(0)read onlypriority:Float = 0

Methods

stamp(visual:Visual, done:() ‑> Void):Void

Draws the given visual onto the render texture. The drawing operation is not done synchronously. It waits for the next draw stage of the app to perform it, then calls done() when finished. This is expected to be used with a texture autoRender set to false.

@:value({ clipHeight : -1, clipWidth : -1, clipY : -1, clipX : -1, alpha : 0, color : 0xFFFFFF })clear(color:Color = 0xFFFFFF, alpha:Float = 0, clipX:Float = -1, clipY:Float = -1, clipWidth:Float = -1, clipHeight:Float = -1, done:() ‑> Void):Void

Clears the texture, or a specific area of it with a fill color and alpha. The drawing operation is not done synchronously. It waits for the next draw stage of the app to perform it, then calls done() when finished. This is expected to be used with a texture autoRender set to false.

Inherited Events

Defined by Texture

@:dox(show)dispose(entity:Entity):Void

@:dox(show)destroy(entity:Entity):Void

Inherited Variables

Defined by Texture

@:value(false)read onlyisRenderTexture:Bool = false

@:value(null)read onlyasRenderTexture:RenderTexture = null

read onlytextureId:TextureId

The texture ID used by the underlying backend (OpenGL etc...)

read onlynativeWidth:Int

The native width of the texture, not depending on texture density

read onlynativeHeight:Int

The native height of the texture, not depending on texture density

read onlynativeWidthActual:Int

The native actual width of the texture. Same as native width unless underlying backend needs pot (power of two) sizes.

read onlynativeHeightActual:Int

The native actual height of the texture. Same as native height unless underlying backend needs pot (power of two) sizes.

read onlywidth:Float

read onlyheight:Float

@:value(LINEAR)filter:TextureFilter = LINEAR

@:value(CLAMP)wrapS:TextureWrap = CLAMP

Horizontal texture wrap mode

@:value(CLAMP)wrapT:TextureWrap = CLAMP

Vertical texture wrapping mode

@:value(null)asset:ImageAsset = null

Defined by Entity

read onlyhasData:Bool

@:value(null)id:String = null

read onlydestroyed:Bool

read onlydisposed:Bool

@:value(null)read onlyautoruns:Array<Autorun> = null

@editablecomponents:ReadOnlyMap<String, Component>

Public components mapping. Contain components created separately with component() or macro-based components as well.

scriptContent:ScriptContent

Available with script plugin

script:Script

Available with script plugin

Inherited Methods

Defined by Texture

setWrap(wrapS:TextureWrap, ?wrapT:TextureWrap):Void

Shorthand for setting both wrapS and wrapT at the same time. Possible values: CLAMP, REPEAT, MIRROR

Parameters:

wrapS

horizontal wrap mode

wrapT

vertical wrap mode

@:value({ reversePremultiplyAlpha : true })inlinetoPng(path:String, reversePremultiplyAlpha:Bool = true, done:() ‑> Void):Void

@:value({ reversePremultiplyAlpha : true })inlinetoPng(reversePremultiplyAlpha:Bool = true, done:(data:Bytes) ‑> Void):Void

Export texture as PNG data and save it to the given file path

Parameters:

path

The png file path where to save the image ('/path/to/image.png')

done

Called when the png has been exported

Defined by Entity

dispose():Void

Schedules destroy, at the end of the current frame.

unbindEvents():Void

Remove all events handlers from this entity.

autorun(run:() ‑> Void, ?afterRun:() ‑> Void):Autorun

Creates a new Autorun instance with the given callback associated with the current entity.

Parameters:

run

The run callback

Returns:

The autorun instance

tween(?easing:Easing, duration:Float, fromValue:Float, toValue:Float, update:(Float, Float) ‑> Void):Tween

component<C>(?name:String, ?component:Null<C>):C