Skip to content

Latest commit

 

History

History
45 lines (32 loc) · 637 Bytes

File metadata and controls

45 lines (32 loc) · 637 Bytes

View / Camera

View controls projection, camera movement, viewport, and camera effects.

Follow

view.follow(player, {
    lerp: 0.15,
    offsetX: 0,
    offsetY: -32,
});

Use clearFollow() to stop.

Bounds Clamp

view.setBounds(new Rectangle(0, 0, worldWidth, worldHeight));
view.clearBounds();

Shake

view.shake(8, 180, {
    frequency: 14,
    decay: true,
});

view.stopShake();

Zoom

view.setZoom(1.25);
view.zoomIn(0.1);
view.zoomOut(0.1);

Update

Application.update() already calls view.update(deltaMilliseconds) each frame for the active render manager view.