Skip to content

ICamera.ClampToBounds(Rectangle) Method

Definition

Namespace: Brine2D.Rendering

Clamps the camera position to stay within world bounds.

void ClampToBounds(Brine2D.Core.Rectangle worldBounds);

Parameters

worldBounds Rectangle

The world boundaries to clamp to.

Example

// Keep camera within level bounds
camera.ClampToBounds(new Rectangle(0, 0, levelWidth, levelHeight));