UiRuntime
- Namespace: Turian.Engine.UI
- Source File: UiRuntime.cs
Drives one Guinevere Gui instance from the engine loop: runs the two-pass build → layout → render cycle into a IUiRenderBackend and hands back the frame as an engine Texture.
Remarks
One runtime owns one surface. The screen-space compositor uses a single runtime for every overlay panel; a world-space panel gets its own. Fonts are resolved from the system family list for now — loading fonts as project assets is a later step, so icon glyphs from the FontAwesome range do not render yet.
Properties
Gui
(Gui) = new(): The Guinevere context, for callers that need to read input/time or set scope values.
Texture
(Texture?): The most recently rendered frame, or null before the first Render.
Size
((int Width, int Height)): Current surface size in pixels.
Public Methods
Render
public Texture Render(Action<Gui> build, int width, int height, float deltaTime, float canvasScale = 1f)
Runs one UI frame and publishes it to Texture.
Parameters:
build(Action): Builds the UI. Invoked twice — once for the layout pass and once for the render pass — so it must be idempotent, which is the normal immediate-mode contract. width(int): Surface width in pixels for this frame, greater than zero.height(int): Surface height in pixels for this frame, greater than zero.deltaTime(float): Seconds since the previous frame, forGuianimations.canvasScale(float): Uniform scale applied to the canvas before building, so a layout authored at a reference resolution fills a differently-sized surface. 1 means no scaling. (Default:1f)
Returns: Texture
- The rendered frame as a texture.
Dispose
public void Dispose()