ScreenFollowOptions
Defined in: renderer/src/ScreenFollow.ts:17
Options for ScreenFollow.
Properties
Section titled “Properties”camera
Section titled “camera”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.
offset?
Section titled “offset?”
optionaloffset?: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
Section titled “target”target:
ScreenFollowTarget
Defined in: renderer/src/ScreenFollow.ts:19
What world coord to track.
trackRotation?
Section titled “trackRotation?”
optionaltrackRotation?: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.