M2O Scripting APIScripting reference
    Preparing search index…
    Global objectClient API

    Camera

    Camera: { worldToScreen(x: number, y: number, z: number): ScreenPosition }

    Client helpers for projecting world positions through the active game camera.

    Type Declaration

    • worldToScreen: function
      • Projects a world-space position to display pixel coordinates.

        Parameters

        • x: number

          World X coordinate.

        • y: number

          World Y coordinate.

        • z: number

          World Z coordinate.

        Returns ScreenPosition

        Screen coordinates and whether the point is visible through the active camera.

        const point = Camera.worldToScreen(10, 20, 5);
        if (point.visible) {
        // point.x and point.y are display pixels.
        }