Preparing search index...
        // ScreenTransformConstraints control how a ScreenTransform reacts to
    // its parent's size changes — fix one axis or pin to specific edges.
    // Common pattern: keep a HUD button at fixed pixel size, pinned to the
    // top-right of the screen so it stays put when the canvas resizes.
    const model = this.pluginSystem.findInterface(Editor.Model.IModel) as Editor.Model.IModel;
    const scene = model.project.scene;

    const canvasObj = scene.createSceneObject('UICanvas');
    canvasObj.addComponent('Canvas');

    const buttonObj = scene.createSceneObject('PinnedButton');
    buttonObj.setParent(canvasObj);
    const st = buttonObj.addComponent('ScreenTransform') as Editor.Components.ScreenTransform;

    st.constraints.fixedWidth = true; // keep width regardless of parent size
    st.constraints.fixedHeight = true; // keep height regardless of parent size
    st.constraints.pinToTop = true; // anchor to top edge
    st.constraints.pinToRight = true; // anchor to right edge

    console.log('ScreenTransform pinned to top-right with fixed dimensions');
    Index

    Constructors

    Properties

    fixedHeight: boolean

    Lock the screen transform height in place.

    fixedWidth: boolean

    Lock the screen transform width in place.

    pinToBottom: boolean

    Anchor the screen transform to the bottom edge.

    pinToLeft: boolean

    Anchor the screen transform to the left edge.

    pinToRight: boolean

    Anchor the screen transform to the right edge.

    pinToTop: boolean

    Anchor the screen transform to the top edge.