Skip to main content

Function: worldToScreenSpace()

worldToScreenSpace(worldPosition, cameraPosition, cameraZoom, canvasCenter): Vector2

Defined in: rendering/transforms/world-to-screen-space.ts:12

Converts a position from world space to screen space.

Parameters

worldPosition

Vector2

The position in world space.

cameraPosition

Vector2

The position of the camera in world space.

cameraZoom

number

The zoom level of the camera.

canvasCenter

Vector2

The center of the canvas.

Returns

Vector2

The position in screen space.