The 2D layer · function

clipRectFor

The rectangle node may draw into, cut by every clipping ancestor between it and root.

Explained in Sprites and tilemaps.

function clipRectFor(root: UiNode, node: UiNode, out: UiRect): boolean
import { clipRectFor } from '@driftengine/ui2d';

Parameters

ParameterTypeDescription
rootUiNode
nodeUiNode
outUiRect

In depth

Returns false when nothing of it survives, which is the caller's signal to skip the subtree rather than issue a draw that covers no pixels.