VisionOSWindowPositionType

enum

Namespace: Vuplex.WebView

The position type for VisionOSWindowPosition. This API mimics the native SwiftUI WindowPlacement.Position structure with which it is implemented.

Summary

Values

Above

Window position relative to the top edge of another window or scene, specified via the VisionOSWindowPosition constructor's relativeWindowID parameter.

Example

#if UNITY_VISIONOS && !UNITY_EDITOR
    var webView = await VisionOSWebView.CreateInWindow(
        new VisionOSWindowOptions {
            Size = new Vector2Int(1000, 1000),
            Position = new VisionOSWindowPosition(
                VisionOSWindowPositionType.Above,
                VisionOSWindowPosition.UnityBoundedSceneID
            )
        }
    );
#endif

Below

Window position relative to the bottom edge of another window or scene, specified via the VisionOSWindowPosition constructor's relativeWindowID parameter.

Example

#if UNITY_VISIONOS && !UNITY_EDITOR
    var webView = await VisionOSWebView.CreateInWindow(
        new VisionOSWindowOptions {
            Size = new Vector2Int(1000, 1000),
            Position = new VisionOSWindowPosition(
                VisionOSWindowPositionType.Below,
                VisionOSWindowPosition.UnityBoundedSceneID
            )
        }
    );
#endif

Leading

Window position relative to the leading (left) edge of another window or scene, specified via the VisionOSWindowPosition constructor's relativeWindowID parameter.

Example

#if UNITY_VISIONOS && !UNITY_EDITOR
    var webView = await VisionOSWebView.CreateInWindow(
        new VisionOSWindowOptions {
            Size = new Vector2Int(1000, 1000),
            Position = new VisionOSWindowPosition(
                VisionOSWindowPositionType.Leading,
                VisionOSWindowPosition.UnityBoundedSceneID
            )
        }
    );
#endif

Trailing

Window position relative to the trailing (right) edge of another window or scene, specified via the VisionOSWindowPosition constructor's relativeWindowID parameter.

Example

#if UNITY_VISIONOS && !UNITY_EDITOR
    var webView = await VisionOSWebView.CreateInWindow(
        new VisionOSWindowOptions {
            Size = new Vector2Int(1000, 1000),
            Position = new VisionOSWindowPosition(
                VisionOSWindowPositionType.Trailing,
                VisionOSWindowPosition.UnityBoundedSceneID
            )
        }
    );
#endif

UtilityPanel

Utility panel window position. Utility panel window placement brings the window close, generally within direct touch range. This is the only VisionOSWindowPositionType for which a RelativeWindowID value is not required.

Example

#if UNITY_VISIONOS && !UNITY_EDITOR
    var webView = await VisionOSWebView.CreateInWindow(
        new VisionOSWindowOptions {
            Size = new Vector2Int(600, 400),
            Position = new VisionOSWindowPosition(
                VisionOSWindowPositionType.UtilityPanel
            )
        }
    );
#endif