GraphicalDisplay

One persistent RGB canvas. Drawing is clipped to its bounds and publishes immediately by default.

Types

Link copied to clipboard

Properties

Link copied to clipboard
val height: Int
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val width: Int

Functions

Link copied to clipboard
fun clear(color: Int = 0)
Link copied to clipboard
fun fillRect(bounds: Rect2i, color: Int)
fun fillRect(position: Position2i, size: Size2i, color: Int)
fun fillRect(x: Int, y: Int, width: Int, height: Int, color: Int)
Link copied to clipboard
inline fun GraphicalDisplay.frame(block: DisplayFrame.() -> Unit)

Records bounded drawing packets and publishes them together. Exceptions discard the frame; nesting fails.

Link copied to clipboard
fun image(position: Position2i, size: Size2i, pixels: IntArray)

fun image(x: Int, y: Int, width: Int, height: Int, pixels: IntArray)

Draws tightly packed row-major RGB pixels. At most 65536 pixels per image.

Link copied to clipboard
fun line(start: Position2i, end: Position2i, color: Int)
fun line(x0: Int, y0: Int, x1: Int, y1: Int, color: Int)
Link copied to clipboard
fun pixel(position: Position2i, color: Int)

Typed pixel coordinates; floating vectors require an explicit rounding conversion.

fun pixel(x: Int, y: Int, color: Int)
Link copied to clipboard

Takes the oldest click, or null. Claims this program's exclusive display lease.

Link copied to clipboard

Polls transient held-right-click input in whole-screen coordinates, independently of pollClick.

Link copied to clipboard
fun rect(bounds: Rect2i, color: Int)
fun rect(position: Position2i, size: Size2i, color: Int)
fun rect(x: Int, y: Int, width: Int, height: Int, color: Int)
Link copied to clipboard
fun setMode(mode: DisplayMode)

Changing density clears the image. Selecting the current mode preserves it.

Link copied to clipboard
fun text(position: Position2i, text: String, color: Int = 16777215, scale: Int = 1)

fun text(x: Int, y: Int, text: String, color: Int = 16777215, scale: Int = 1)

Monospaced 6x12 glyphs, scaled by 1..8; newline starts the next line.