logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class 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.

    Inheritance
    object
    PreviewOverlayPainter
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    Namespace: Serenity.Ui.Infrastructure.Editor.Preview
    Assembly: Serenity.UnityUi.Infrastructure.Editor.dll
    Syntax
    public sealed class PreviewOverlayPainter
    Remarks

    The drawing side of direct manipulation, where PreviewGestureCoordinator is the input side. It reads that coordinator rather than tracking selection or hover itself — a second copy of either would only ever be right until the two disagreed — and hands the actual painting to the stateless PreviewOverlayGui.

    Constructors

    PreviewOverlayPainter(Func<PreviewSceneRenderer>, PreviewGestureCoordinator)

    Creates a painter.

    Declaration
    public PreviewOverlayPainter(Func<PreviewSceneRenderer> renderer, PreviewGestureCoordinator coordinator)
    Parameters
    Type Name Description
    Func<PreviewSceneRenderer> renderer

    The preview's current scene renderer, re-read on every call.

    PreviewGestureCoordinator coordinator

    The coordinator whose selection, hover and gesture state this draws.

    Methods

    Draw(Rect)

    Draws hover and selection chrome for the current frame, clipped to it so nothing leaks past the scrollview when the preview is zoomed and panned.

    Declaration
    public void Draw(Rect frame)
    Parameters
    Type Name Description
    Rect frame

    The rectangle the preview is drawn into, in screen pixels.

    Remarks

    UnityEditor.Handles calls only work inside an IMGUI window wrapped in Handles.BeginGUI/ EndGUI, and everything inside GUI.BeginClip draws in coordinates relative to the clip's origin — so every quad is translated by -frame.position before it reaches PreviewOverlayGui, which otherwise knows nothing about frames or clipping.

    In this article
    © 2026 Serenity. All Rights Reserved