Camera2D Module
Helper functions for 2D Cameras (Orthographic projection).
Use these for top-down, side-scrolling, or any 2D game rendering.
The camera struct's fields are immutable, so the movement helpers
(smoothFollow / clampTarget) return a new camera rather than
mutating in place.
Functions and values
| Function or value |
Description
|
|
|
|
|
|
Create a rendering config from a 2D camera. Defaults: fullscreen, no clear.
|
|
|
|
|
Full Usage:
splitScreenBottom camera clearColor bounds
Parameters:
Camera2D
clearColor : Color
bounds : Rectangle
-
Parent viewport bounds in pixels (typically the window size).
Returns: Camera2DConfig
Modifiers: inline |
Split-screen bottom half. Clears with given color.
|
Full Usage:
splitScreenLeft camera clearColor bounds
Parameters:
Camera2D
clearColor : Color
bounds : Rectangle
-
Parent viewport bounds in pixels (typically the window size).
Returns: Camera2DConfig
Modifiers: inline |
Split-screen left half. Clears with given color.
|
Full Usage:
splitScreenRight camera clearColor bounds
Parameters:
Camera2D
clearColor : Color
bounds : Rectangle
-
Parent viewport bounds in pixels (typically the window size).
Returns: Camera2DConfig
Modifiers: inline |
Split-screen right half. Clears with given color.
|
Full Usage:
splitScreenTop camera clearColor bounds
Parameters:
Camera2D
clearColor : Color
bounds : Rectangle
-
Parent viewport bounds in pixels (typically the window size).
Returns: Camera2DConfig
Modifiers: inline |
Split-screen top half. Clears with given color.
|
|
|
|
|
Full Usage:
withClear color config
Parameters:
Color
config : Camera2DConfig
Returns: Camera2DConfig
Modifiers: inline |
Clear with this color before rendering.
|
Full Usage:
withViewport viewport config
Parameters:
Rectangle
config : Camera2DConfig
Returns: Camera2DConfig
Modifiers: inline |
Set viewport in pixel coordinates.
|
|
Mibo