Skip to main content

ActorFrame

Function ActorFrame 

Source
pub fn ActorFrame(
    center: [f32; 2],
    size: [f32; 2],
    geom: GeomHandle,
    mirror_x: bool,
    child: View,
) -> View
Expand description

A world-anchored surface: child (painting in its own local coords) is boxed to a size rect centered on a world center, positioned through the viewport’s FrameGeom. Siblings of Viewport2d - e.g. live actor surfaces - track sim positions without game-side unit math, glued to sprites and picks even under camera shake. mirror_x flips around the surface center (left-walking hordes reusing right-facing art).

Timing: offsets derive from the last painted FrameGeom, so the surface trails the board by one frame while the camera moves (see FrameGeom). Steady-state placement is exact.