The 2D layer · interface

UiNodeOptions

Explained in Sprites and tilemaps.

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

Properties

NameTypeDescription
directionreadonlyoptional'row' | 'column'
widthreadonlyoptionalUiSize
heightreadonlyoptionalUiSize
paddingreadonlyoptionalnumberOne number for all four sides. Set the four fields for anything else.
gapreadonlyoptionalnumber
alignreadonlyoptionalUiAlign
justifyreadonlyoptionalUiJustify
absolutereadonlyoptionalbooleanTaken out of the flow and placed at x, y inside the parent's content box.
xreadonlyoptionalnumber
yreadonlyoptionalnumber
contentWidthreadonlyoptionalnumberWhat a fit node measures when it has no children: a label's text, an icon's size.
contentHeightreadonlyoptionalnumber
hiddenreadonlyoptionalboolean
clipreadonlyoptionalbooleanWhether this node cuts its descendants to its own rectangle.
More

Off by default, because most nodes do not clip and one that does costs a scissor change in the pass. A scroll container sets it and a panel sets it; a row of buttons does not.

scrollXreadonlyoptionalnumberHow far this node's contents are moved under it. Only meaningful with clip.
scrollYreadonlyoptionalnumber
layerreadonlyoptionalnumberDraw order beyond tree order. Inherited by descendants that do not set their own.
backgroundreadonlyoptionalArrayLike<number> | null
texturereadonlyoptionalnumberThe sprite slot this node draws from, or -1 for none.
framereadonlyoptionalSpriteFrame | null
tintreadonlyoptionalArrayLike<number> | null
textreadonlyoptionalstring
interactivereadonlyoptionalboolean
focusablereadonlyoptionalboolean
namereadonlyoptionalstringFor a caller to find its own node again. Not read by anything here.