Skip to content

ScreenFollowOptions

Defined in: renderer/src/ScreenFollow.ts:17

Options for ScreenFollow.

camera: CameraEntity

Defined in: renderer/src/ScreenFollow.ts:26

Camera whose worldToScreen projection defines the screen mapping. Required — YAGE doesn’t have a global “main” camera, so the projection source must be explicit.


optional offset?: Vec2Like

Defined in: renderer/src/ScreenFollow.ts:36

Screen-pixel offset added to the projected position. Default (0, 0).

Applied after projection (cam.worldToScreen(target) + offset), not before — so the visual gap between UI and target stays fixed under any camera zoom or rotation. Adding it in world coords before projection would let the camera transform warp the offset.


target: ScreenFollowTarget

Defined in: renderer/src/ScreenFollow.ts:19

What world coord to track.


optional trackRotation?: boolean

Defined in: renderer/src/ScreenFollow.ts:46

When the target is an Entity, copy its worldRotation onto this entity’s Transform each frame. Useful when the UI should rotate with the target itself (e.g. a vehicle UI that tilts with the vehicle) but stay stable against the camera. Default false — this entity’s rotation is left alone, so a panel on a screen-space layer renders axis-aligned. Ignored when target is a Vec2 or a function.