Class Camera
Stores the camera.
Functions
| camera.default () | Gets the default camera. |
| camera:scale () | Gets the scale of the camera. |
| camera:offset () | Gets the offset of the camera. |
| camera:transition_scale () | Gets the offset of the camera post transition |
| camera:transition_offset () | Gets the offset of the camera post transition |
Functions
Methods- camera.default ()
-
Gets the default camera.
Returns:
-
Camera
The default camera.
- camera:scale ()
-
Gets the scale of the camera.
Returns:
-
float32
the scale
See also:
- camera:offset ()
-
Gets the offset of the camera.
Returns:
-
Vec2
offset
See also:
Usage:
cam = Camera.default() rect = Rect.new(0, 0, 20, 20) -- convert the rect to screen space rect = rect:scale(cam:scale()):offset(cam:offset()) - camera:transition_scale ()
-
Gets the offset of the camera post transition
Returns:
-
float32
the scale
See also:
- camera:transition_offset ()
-
Gets the offset of the camera post transition
Returns:
-
Vec2
offset
See also:
Usage:
cam = Camera.default() rect = Rect.new(0, 0, 20, 20) -- convert the rect to screen space rect = rect:scale(cam:transition_scale()):offset(cam:transition_offset())