Skip to content

CameraExtensions

Namespace: SideXP.Core

public static class CameraExtensions

Extension functions for Camera instances.

Methods

GetExtentsOrthographic(Camera)

public static Vector2 GetExtentsOrthographic(Camera camera)

Calculates the camera render extents, using orthographic mode. The extents are Vector2(orthographic size * aspect ratio, orthographic size). You can use this value to automatically define screen limits.

Parameters

  • camera: The Camera of which you want to get the extents.

Returns

Returns the computed extents.

GetBoundsOrthographic(Camera)

public static Vector2 GetBoundsOrthographic(Camera camera)

Calculates the camera render extents using GetExtentsOrthographic and doubles them to get bounds, using orthographic mode.

Parameters

  • camera: The Camera of which you want to get the bounds.

Returns

Returns the computed bounds.