Window

abstract class Window(var width: Int, var height: Int, var pixelRatio: Float = 1.0f)

Window

This class represents the physical window that PolyUI will render to. As a window implementation, you must:

Constructors

Link copied to clipboard
constructor(width: Int, height: Int, pixelRatio: Float = 1.0f)

Properties

Link copied to clipboard
open var height: Int
Link copied to clipboard
open var pixelRatio: Float
Link copied to clipboard
open var width: Int

Functions

Link copied to clipboard
abstract fun close()

destroy the window.

Link copied to clipboard
abstract fun getClipboard(): String?

Get the clipboard string. This is used for the org.polyfrost.polyui.component.impl.TextInput class.

Link copied to clipboard
abstract fun getKeyName(key: Int): String

Return the name of a key that is not mapped by PolyUI.

Link copied to clipboard
abstract fun open(polyUI: PolyUI): Window

open the window with the specified PolyUI instance, and then start the rendering loop. It may be blocking or non-blocking. Every frame, call the PolyUI.render function to render the UI.

Link copied to clipboard
open fun postRender(renderer: Renderer)

this function hooks into the rendering loop. it is ran after a render cycle.

Link copied to clipboard
open fun preRender(renderer: Renderer)

this function hooks into the rendering loop. it is ran before a render cycle.

Link copied to clipboard
abstract fun setClipboard(text: String?)

Set the clipboard string. This is used for the org.polyfrost.polyui.component.impl.TextInput class.

Link copied to clipboard
abstract fun setCursor(cursor: Cursor)

Set the cursor design.

Link copied to clipboard

Return true if your window supports "render pausing", a optimization technique which will not render any frames if not necessary.