Static ReadonlydefaultsDefault style constants for all CSS-driven controls.
Focus ring rendering parameters.
Stroke opacity.
Inset from the element's bounding rect (in points).
Stroke width (in points).
Fixed outer radius for interactive spotlight radial gradients (in points).
StaticcomputeComputes the content rectangle by subtracting padding from the element bounds. This is the region inside the background where text, images and sub-elements are drawn.
The element's full bounds from UIDrawContent.
The resolved CSS style for the element.
A Rect2 inset by the style's padding values.
StaticcomputeComputes the stroke-inset rectangle so that the border stroke stays within element bounds. Insets by half the border width on each side.
The element's full bounds.
The resolved CSS style for borderWidth and borderColor.
The inset rectangle, or bounds unchanged if no stroke is needed.
StaticdrawDraws a rounded rectangle background with fill and optional border stroke onto the given path. The rectangle is inset by half the border width so the stroke remains within the original bounds.
When state and mousePositionLocal are provided and the element is Hover or Active, both fill and stroke use radial gradient paints centered at the cursor (matching the C++ CreateButtonPath pattern with CreateInteractiveGradientFill/Stroke). Otherwise solid paints are used.
The path to append draw commands to.
The element's full bounds from UIDrawContent.
The resolved CSS style providing background, border, and border-radius values.
Optionalstate: EnumValue<UIElementState, number>Optional element state bitfield for interactive gradient.
OptionalmousePositionLocal: Immutable<Vector2>Optional mouse position in local coordinates for interactive gradient.
OptionalradiusTopLeft: numberOptionalradiusTopRight: numberOptionalradiusBottomLeft: numberOptionalradiusBottomRight: numberStaticdrawDraws a drop shadow below the given bounds. The caller must shrink the effective bounds by shadowOffset so both the element and its shadow stay within the bounding rect.
The UIDrawContent to add the shadow path to.
The effective (inset) bounds the element is drawn at.
The resolved CSS style for corner radii.
OptionalshadowOffset: numberThe vertical point offset for the shadow. Defaults to 1.
OptionalshadowAlpha: numberThe opacity of the shadow. Defaults to 0.25.
Optionaldepth: numberThe draw depth for the shadow path. Defaults to -1.
OptionalradiusTopLeft: numberOptionalradiusTopRight: numberOptionalradiusBottomLeft: numberOptionalradiusBottomRight: numberStaticdrawDraws a focus ring around the element. Only draws if the Focused bit is set in state. The ring is a stroke rendered slightly outside the element bounds using a semi-transparent accent color.
The path to append draw commands to.
The element's full bounds.
The resolved CSS style for corner radii.
The current element state bitfield.
The accent color to use for the focus ring.
OptionalfocusInset: numberOptional inward inset in points. Defaults to 2.
OptionalradiusTopLeft: numberOptionalradiusTopRight: numberOptionalradiusBottomLeft: numberOptionalradiusBottomRight: numberStaticdrawDraws a luminance gradient fill inside the track area of a control. The gradient goes from
transparent to the accent color (style.textColor), left-to-right for horizontal or
bottom-to-top for vertical orientation.
The UIDrawContent to add the gradient path to.
The element's full bounds.
The resolved CSS style providing borderWidth, borderRadius, and textColor.
Optionalvertical: booleanWhether to draw the gradient vertically (bottom-to-top) instead of horizontally.
OptionalradiusTopLeft: numberOptionalradiusTopRight: numberOptionalradiusBottomLeft: numberOptionalradiusBottomRight: numberStaticdrawDraws text inside the content rect using CSS style properties for font, color, and alignment.
The UIDrawContent to add the text element to.
The string to display.
The area within which text is positioned, typically from computeContentRect().
The resolved CSS style for font, color, and alignment.
Optionalfont: FontOptional font override. Pass a bold font for font-weight >= 700.
StatichasReturns true if the given state bitfield contains the specified UIElementState flag.
The current element state from generateDrawContent.
The state flag to check (e.g., UIElementState.Hover).
True if the flag is set.
StaticmapMaps a CSS TextAlign to TextHorizontalAlignType. Justify falls back to Left.
The corresponding TextHorizontalAlignType.
StaticmapMaps a CSS VerticalAlign to TextVerticalAlignType. Baseline falls back to Top.
The CSS vertical-align value from ComputedStyle.
The corresponding TextVerticalAlignType.
Shared drawing utility functions for UICustomElement-based controls.
These functions replicate the common drawing patterns from the C++ UIDrawables class, adapted for CSS-driven ComputedStyle and the TypeScript Path/Paint API. Functions are composable: call them in sequence on the same Path and UIDrawContent.