You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+17-1Lines changed: 17 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ Select the script component attached to the ```camera.go``` to modify the proper
22
22
This is the near and far z-values used in the projection matrix, ie the near and far clipping plane. Anything with a z-value inside this range will be drawn by the render script.
23
23
24
24
#### zoom (number)
25
-
This is the zoom level of the camera. Modify it by calling ```camera.zoom_to()```. Read it using ```camera.get_zoom()``` or using```go.get(camera_id, "zoom")```.
25
+
This is the zoom level of the camera. Modify it by calling ```camera.zoom_to()```, ```go.set(camera, "zoom")``` or ```go.animate(camera, "zoom", ...)```. Read it using ```camera.get_zoom()``` or ```go.get(camera_id, "zoom")```.
26
26
27
27
#### projection (hash)
28
28
The camera can be configured to support different kinds of orthographic projections. The default projection (aptly named ```DEFAULT```) uses the same orthographic projection matrix as in the default render script (ie aspect ratio isn't maintained and content is stretched). Other projections are available out-of-the box:
@@ -37,6 +37,22 @@ Additional custom projections can be added, see ```camera.add_projector()``` bel
37
37
#### enabled (boolean)
38
38
This controls if the camera is enabled by default or not. Send ```enable``` and ```disable``` messages to the script or use ```go.set(id, "enable", true|false)``` to toggle this value.
39
39
40
+
#### follow (boolean)
41
+
This controls if the camera should follow a target or not. See ```camera.follow()``` for details.
42
+
43
+
#### follow_target (hash)
44
+
Id of the game object to follow. See ```camera.follow()``` for details.
45
+
46
+
#### follow_lerp (number)
47
+
Amount of lerp when following a target. See ```camera.follow()``` for details.
The camera deadzone. See ```camera.deadzone()``` for details.
54
+
55
+
40
56
## Render script integration
41
57
While the camera is enabled it will send ```set_view_projection``` messages once per frame to the render script. The message is the same as that of the camera component, meaning that it contains ```id```, ```view``` and ```projection``` values. Make sure that these values are handled and used properly in the render script:
0 commit comments