logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

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

    Namespace: Serenity.Ui.Infrastructure.Editor.Preview
    Assembly: Serenity.UnityUi.Infrastructure.Editor.dll
    Syntax
    public interface IPreviewPlacementTarget

    Properties

    Owner

    The asset or scratch instance the placements belong to — Undo, dirtying and the identity a listening wizard checks a PreviewInteraction against all key off it, not off any one element.

    Declaration
    Object Owner { get; }
    Property Value
    Type Description
    Object

    Methods

    DescribeElement(int)

    A label for the element, for overlay chips and tooltips.

    Declaration
    string DescribeElement(int elementIndex)
    Parameters
    Type Name Description
    int elementIndex

    The element to describe.

    Returns
    Type Description
    string

    The label, or empty when the index does not address an element.

    TryReadPlacement(int, out PreviewElementPlacement)

    The current placement of one element.

    Declaration
    bool TryReadPlacement(int elementIndex, out PreviewElementPlacement placement)
    Parameters
    Type Name Description
    int elementIndex

    The element to read.

    PreviewElementPlacement placement

    The element's placement, when found.

    Returns
    Type Description
    bool

    False when the index no longer addresses an element right now.

    TryWritePlacement(int, HudElementTransform)

    Writes a gesture's result onto one element.

    Declaration
    bool TryWritePlacement(int elementIndex, HudElementTransform transform)
    Parameters
    Type Name Description
    int elementIndex

    The element to write.

    HudElementTransform transform

    The offset, scale, stretch and rotation to write, in authored (pre-mirror) space.

    Returns
    Type Description
    bool

    False when the index is not valid right now.

    In this article
    © 2026 Serenity. All Rights Reserved