The 2D layer · interface

UiContentSink

Where a caller draws what a quad cannot be.

Explained in Sprites and tilemaps.

interface UiContentSink
import type { UiContentSink } from '@driftengine/ui2d';

In depth

Text is the whole of it today. This package draws textured quads and core already draws two kinds of text — drawText from the pixel font and drawSdfText from an atlas — so the honest seam is that the tree says where a label goes and the caller says how it is drawn. Wrapping either here would mean this package importing the renderer's verb surface to re-export it.

Called with the node's resolved rect already filled in, in the order the node is drawn, so a label lands over its own background and under whatever is drawn after it.

Methods

content

content(node: UiNode, visible: UiRect): void

visible is the part of the node its clipping ancestors leave on screen, which outside any clip is the whole of it. Text has to be cut where the quads are, and only the caller drawing it can cut it: a label in a row half scrolled out of a list is skipped, or drawn cut, here.

ParameterTypeDescription
nodeUiNode
visibleUiRect