logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Namespace Serenity.Ui.Infrastructure.Editor.Preview

    Classes

    CompositePreviewBuilder

    Builds a composite view into the preview canvas by flex-solving its child regions (reusing the runtime FlexboxSolver + LayoutConfig) and recursing — nested composites recurse, hosted menus are built by MenuPreviewBuilder. SWITCHER containers show their resolved active child. Guards depth and reference cycles like the original wireframe.

    MenuPreviewBuilder

    Builds a real, themed menu into a preview canvas using the chosen theme's actual prefab templates (background, title, per-interaction option rows), positioned with a layout pass that mirrors the runtime UnityMenuLayoutBuilder — direction, gaps, alignment, the horizontal width modes and the scroll clamp — without needing any runtime services. The components' own scripts do not run in edit mode (no [ExecuteAlways]), so only their serialized visuals (Image/TMP/Slider state) are rendered.

    MenuPreviewResult

    What MenuPreviewBuilder reports back about a built menu so the window can overlay info chips, the selected highlight and the scroll affordance, and hit-test clicks to option rows.

    PreviewGestureController

    Tracks one in-progress move, scale, deform or rotate gesture on the preview: what started it, and the Undo group it should collapse into on release.

    PreviewGestureCoordinator

    Everything the mouse does over a direct-manipulation preview: hit-testing the pointer against the rendered elements, click-to-select, and running a move/scale/rotate gesture against the selected one.

    PreviewGestureHelpPopup

    The preview toolbar's "?" popup: a fixed cheat-sheet of the direct-manipulation gestures and their modifier keys, mirroring the "Editing in the preview" section of the HUD cookbook.

    PreviewHitTesting

    Turns a preview element's live UnityEngine.RectTransform into a rotation-safe PreviewQuad, and resolves mouse points against it: which element is under the pointer, and which handle of the selected one.

    PreviewLocalization

    Best-effort, edit-mode translation of localization keys for the View Preview, so the preview shows the same text the game would instead of raw keys (which are much longer and overflow the screen).

    PreviewOverlayGui

    Draws the preview's interaction chrome: hover and selection outlines, the selected element's transform handles, id and readout chips, and the per-handle cursor.

    PreviewOverlayPainter

    Everything drawn over the rendered frame in response to the mouse: hover and selection chrome, the transform/rotate handles, the live gesture readout, and the cursor the pointer shows over each of them.

    PreviewResolutionPresets

    Shared reference-resolution presets and letterboxing math for the editor preview tools (the Composite View Builder wireframe and the View Preview live render). Keeping it in one place means both tools offer the same screen list and scale fixed-px content the same way.

    PreviewSceneRenderer

    Off-screen render rig for the View Preview tool: a hidden WorldSpace UnityEngine.Canvas sized to the chosen reference resolution, captured by an orthographic UnityEngine.Camera into a UnityEngine.RenderTexture. The caller populates the canvas with real (themed) UI prefabs each frame; the rig renders them and returns the texture for the editor window to blit.

    Structs

    PreviewElementHandle

    One built preview element: which authored element it is, and the container to hit-test it by.

    PreviewElementPlacement

    One element's placement, as the manipulation stack sees it: everything IHudPlacedElement declares, plus scale, stretch and the parented flag a gesture also has to read.

    PreviewInteraction

    One interaction raised by a preview window's own static Interacted event, so a listening wizard can follow what happens in the preview without the preview knowing anything about the wizard.

    PreviewQuad

    One HUD element's footprint, projected into the preview frame: a rotated rectangle rather than an axis-aligned one, since an element can carry rotation.

    Interfaces

    IPreviewPlacementTarget

    What PreviewGestureCoordinator and PreviewOverlayPainter need from whatever they are previewing: reading and writing one element's placement by index, and the identity to raise an interaction with. A HUD element and a leaderboard view element in the designer are both screen-anchored with HUD-style offsets, so either can satisfy this without the manipulation stack knowing which one it is.

    Enums

    PreviewGestureKind

    What a preview gesture is doing to the element it grabbed.

    PreviewHandle

    Which part of the selected element's gizmo a gesture grabbed.

    PreviewInteractionKind

    What kind of interaction happened in the preview.

    In this article
    © 2026 Serenity. All Rights Reserved