ICamera Interface
Represents a 2D camera for viewing the game world.
public interface ICamera
Derived
↳ Camera2D
↳ IShakableCamera
| Properties | |
|---|---|
| Position | Gets or sets the camera position in world space. |
| Rotation | Gets or sets the camera rotation in degrees. |
| ViewportHeight | Gets the viewport height in pixels. |
| ViewportWidth | Gets the viewport width in pixels. |
| Zoom | Gets or sets the camera zoom level (1.0 = normal, 2.0 = 2x zoom in). |
| Methods | |
|---|---|
| ClampToBounds(Rectangle) | Clamps the camera position to stay within world bounds. |
| GetViewMatrix() | Gets the view matrix for transforming world coordinates to camera space. |
| GetVisibleBounds() | Gets the visible world bounds (frustum rectangle). |
| IsVisible(Rectangle) | Checks if a rectangle is visible by the camera (frustum culling). |
| IsVisible(Vector2) | Checks if a world position is visible by the camera. |
| ScreenToWorld(Vector2) | Converts a screen position to world position. |
| SetViewport(int, int) | Sets the viewport size (typically called when window resizes). |
| WorldToScreen(Vector2) | Converts a world position to screen position. |