Static methods

Constructor

@:value({ font : Canvas.defaultFontName })new(canvasName:String, font:String = Canvas.defaultFontName)

Create new CanvasScript from canvas

Parameters:

canvasName

Name of the canvas

font

font file (Optional)

Variables

Methods

getCanvas():Null<TCanvas>

Returns the canvas object of this trait.

Returns:

TCanvas

getElement(name:String):TElement

Returns an element of the canvas.

Parameters:

name

The name of the element

Returns:

TElement

getElements():Array<TElement>

Returns an array of the elements of the canvas.

Returns:

Array

@:access(armory.ui.Canvas)@:access(zui.Handle)getHandle(name:String):Handle

inlinegetUiScale():Float

Get the UI scale factor.

notifyOnReady(f:() ‑> Void):Void

Run the given callback function f when the canvas is loaded and ready.

See also:

setCanvasDimensions(x:Int, y:Int):Void

Set dimensions of canvas

Parameters:

x

Width

y

Height

setCanvasFontSize(fontSize:Int):Void

Set font size of the canvas

Parameters:

fontSize

Size of font to be setted

setCanvasVisibility(visible:Bool):Void

Set visibility of canvas

Parameters:

visible

Whether canvas should be visible or not

inlinesetUiScale(factor:Float):Void

Set the UI scale factor.

Inherited Variables

Defined by Trait

@:value("")name:String = ""

Inherited Methods