UiDocumentComponent

Places a Guinevere UI in a scene. The UI comes from a .ui``Document asset, or — for user scripts — from an OnBuild delegate set in code. The component carries the document reference plus placement and scaling settings; a UiManager discovers it by walking the scene each frame.

Properties

Document

(AssetReference) { get; set } = new(): The .ui document this panel renders. Empty when the UI is supplied via OnBuild.

StyleSheets

(List<AssetReference>) { get; set } = []: Extra .uss stylesheets applied on top of the ones the document declares with &lt;Style src&gt;, lowest priority first.

Mode

(UiRenderMode) { get; set } = UiRenderMode.ScreenSpaceOverlay: Where the UI is drawn. Defaults to a full-screen overlay.

SortOrder

(int) { get; set }: Draw order among screen-space panels: lower values are composited first (further back).

ScaleMode

(UiScaleMode) { get; set } = UiScaleMode.ConstantPixelSize: How the panel's logical size tracks the framebuffer size (screen-space modes).

ReferenceResolution

(Int2) { get; set } = new(1920, 1080): Design resolution for ScaleWithScreenSize.

PanelSize

(Int2) { get; set } = new(1024, 640): Render-target size in pixels for WorldSpace.

OnBuild

(Action?) { get; set }: Builds the UI each frame. Invoked once per layout pass and once per render pass, so it must be idempotent (the standard immediate-mode contract). Not serialized — set it in code.