-
Notifications
You must be signed in to change notification settings - Fork 2
Camera
Isuru Kusumal Rajapakse edited this page Jun 18, 2017
·
1 revision
- Represents a camera that captures a scene.
Void
Create an Camera.
| Name | Type | Description | |
|---|---|---|---|
| id | string |
- name of the Camera. | Optional |
| target | Scene |
- the scene the camera targted at. | |
| x=0 | number |
- x position. | Optional |
| y=0 | number |
- y position. | Optional |
| w=0 | int |
- desired width. | Optional |
| h=0 | int |
- desired height. | Optional |
Void
targets the camera at the given scene
| Name | Type | Description | |
|---|---|---|---|
| target | Scene |
- the scene the camera targted at. |
-
Cameraitself
camera tracks the given object
| Name | Type | Description | |
|---|---|---|---|
| object | GameObject |
- the object the camera starts tracking. |
-
Cameraitself
camera zooms in to, and keeps the constain ratio if enabled
| Name | Type | Description | |
|---|---|---|---|
| amount | int |
- amount to zoom in on. | |
| keepRatio | bool |
- should the camera keep constent ratio while zooming. |
-
Cameraitself
renders the containts within tha camera to the given canvas
| Name | Type | Description | |
|---|---|---|---|
| c | context |
- the canvas to draw the camera on. |
Void
converts camera relative position to absolute position
| Name | Type | Description | |
|---|---|---|---|
| relative | vector2 |
- position witin the camera. |
-
vector2absolute - absolute position
converts camera relative position to absolute position
| Name | Type | Description | |
|---|---|---|---|
| relative | vector2 |
- position witin the camera. |
-
vector2absolute - absolute position
updates the camera just once
Void
renders the camera itself
| Name | Type | Description | |
|---|---|---|---|
| c | context |
- the canvas to draw the camera on. |
Void