Skip to content

ContentDrawScope

interface ContentDrawScope

Receiver scope provided to DrawModifier.draw containing everything needed to render and position content.

Properties

guiGraphics

abstract val guiGraphics: GuiGraphics

The current GuiGraphics context.

height

abstract val height: Int

The height of the node being drawn, in pixels.

width

abstract val width: Int

The width of the node being drawn, in pixels.

x

abstract val x: Int

The absolute x coordinate of the node's top-left corner on screen.

y

abstract val y: Int

The absolute y coordinate of the node's top-left corner on screen.

Functions

drawContent

abstract fun drawContent()

Renders the wrapped content (the node's own renderer and all child nodes).

Call this at any point inside DrawModifier.draw to position the content relative to any surrounding draw operations.