Skip to main content

Module tool_ui

Module tool_ui 

Source
Expand description

UI surface for standalone Khora tools (the hub, future asset cookers, …).

These tools depend on khora-sdk and reach the egui backend exclusively through this module — never directly via egui or eframe. The day the engine swaps backend, this re-export list moves to whichever crate provides the new run_native + AppContext implementation.

This module is the runtime seam only. Khora’s look — the brand palette and the shared widget vocabulary — is cosmetics and lives in the separate khora-tool-ui crate, which the SDK deliberately does not depend on, so a game built on Khora never compiles the engine vendor’s brand. Tools depend on both.

Structs§

Align2
Two-axis alignment — combination of horizontal + vertical Align.
CornerRadius
Per-corner radius of a rounded rectangle, in logical pixels.
FontPack
A collection of fonts grouped by family.
Interaction
Result of an UiBuilder::interact_rect call.
LinearRgba
Represents a color in a linear RGBA color space using f32 components.
Margin
Padding (or outer spacing) on the four sides of a region.
NamedFont
A named font face inside a pack. The name is used by the backend to register the font in its registry and (where applicable) to make it addressable by user code.
Rect2D
A 2D axis-aligned rectangle defined by its top-left corner (min) and bottom-right corner (max).
Stroke
A border or line stroke — colour + thickness.
UiTheme
Color palette and sizing tokens for any Khora UI surface.
Vec2
A 2-dimensional vector with f32 components.
WindowConfigInput
Owned-data window config — mirrors fields of WindowConfig but stays in khora-infra so we don’t drag the platform module definition all the way down to khora-core for tool-only use.
WindowIconInput
RGBA8 pixel buffer + dimensions for the window icon.

Enums§

Align
One-axis alignment — Min (top/left), Center, or Max (bottom/right).
FontFamilyHint
Font family hint passed to UiBuilder::paint_text_styled. Backends map each variant to whichever face was registered for that family.
FontHandle
A bundled font, either as a static slice or owned bytes loaded at runtime.
Icon
A semantic icon identifier mapped to a Lucide codepoint.
InlineEditEvent
Outcome of an UiBuilder::inline_text_field this frame.
TextAlign
Horizontal alignment for UiBuilder::paint_text_styled.

Traits§

App
One application — implements update and gets called once per frame.
AppContext
Top-level app context — one per frame.
AppLifecycle
Optional lifecycle hooks — implement on the same type as App to hook startup / shutdown without inflating the main trait.
UiBuilder
A backend-agnostic, immediate-mode widget builder.

Functions§

run_native
Boot a tool app on the egui+eframe backend.