Koui's main class.

Static variables

@:value("2020.10")staticinlineread onlyKOUI_VERSION:String = "2020.10"

privatestaticanchorPane:AnchorPane

The default layout. Gets initialized in init().

privatestaticbackbuffer:Image

staticread onlyfont:Font

The theme's root kha.Font object (for initialization of components). Used internally only.

staticread onlyfontSize:Int

The theme's root font size (for initialization of components). Used internally only.

privatestaticg:KGraphics

@:value(false)staticread onlyinitialized:Bool = false

True after Koui was successfully initialized.

private@:value(new Array())staticoverlay_offsets:Array<Vector<Int>> = new Array()

private@:value(new Array())staticoverlays:Array<Element> = new Array()

Static methods

@:value({ anchor : TopLeft })staticinlineadd(element:Element, anchor:Anchor = TopLeft):Void

Adds an element to be drawn.

Parameters:

element

The element

anchor

The anchor position of the new element.

privatestaticinlinefilterAssets(asset:Dynamic):Bool

staticgetElementAtPosition(x:Int, y:Int):Null<Element>

Returns the topmost element at the given position. If no element exists at that position, null is returned.

Parameters:

x

The position's x coordinate

y

The position's y coordinate

Returns:

The element at the given position or null if not found

staticinit(done:() ‑> Void):Void

Initializes Koui. Call this in your application's initialization method.

Parameters:

done

Called after Koui successfully initialized and loaded all assets.

privatestaticonResize(width:Int, height:Int):Void

staticinlineregisterOverlay(element:Element):Void

staticinlineremove(element:Element):Void

Removes an element from the drawing list.

Parameters:

element

The element

staticrender(g2:Graphics):Void

Main drawing method responsible for drawing everything. Call this in you render loop.

Parameters:

g2

The kha.graphics2.Graphics object for drawing

staticinlinesetPadding(left:Int, right:Int, top:Int, bottom:Int):Void

Sets the padding values of the default AnchorPane.

Parameters:

left

The left padding

right

The right padding

top

The top padding

bottom

The bottom padding

staticinlinesetPaddingBottom(bottom:Int):Void

Sets the bottom padding of the default AnchorPane.

Parameters:

paddingBottom

The bottom padding

staticinlinesetPaddingLeft(left:Int):Void

Sets the left padding of the default AnchorPane.

Parameters:

paddingLeft

The left padding

staticinlinesetPaddingRight(right:Int):Void

Sets the right padding of the default AnchorPane.

Parameters:

paddingRight

The right padding

staticinlinesetPaddingTop(top:Int):Void

Sets the top padding of the default AnchorPane.

Parameters:

paddingTop

The top padding

staticinlineunregisterOverlay(element:Element):Void