Implements a Camera object.
Kind: global class
Create the camera.
Param | Type | Description |
---|---|---|
gfx | Gfx |
The gfx manager instance. |
Rectangle
Get camera’s viewport (drawing region to set when using this camera).
Kind: instance property of Camera
Returns: Rectangle
- Camera’s viewport as rectangle.
Set camera’s viewport.
Kind: instance property of Camera
Param | Type | Description |
---|---|---|
viewport | Rectangle |
New viewport to set or null to not use any viewport when using this camera. |
Rectangle
Get the region this camera covers.
Kind: instance method of Camera
Returns: Rectangle
- region this camera covers.
Make this camera an orthographic camera with offset.
Kind: instance method of Camera
Param | Type | Description |
---|---|---|
offset | Vector2 |
Camera offset (top-left corner). |
ignoreViewportSize | Boolean |
If true, will take the entire canvas size for calculation and ignore the viewport size, if set. |
near | Number |
Near clipping plane. |
far | Number |
Far clipping plane. |
Make this camera an orthographic camera.
Kind: instance method of Camera
Param | Type | Description |
---|---|---|
region | Rectangle |
Camera left, top, bottom and right. If not set, will take entire canvas. |
near | Number |
Near clipping plane. |
far | Number |
Far clipping plane. |