camera2d
The orthographic camera a flat scene is drawn from. pixels_per_unit scales it, and the last current camera wins; the scene's environment lights it. Only…
Nesta página
2d · render · 4 properties · 2D
The orthographic camera a flat scene is drawn from. pixels_per_unit scales it, and the last current camera wins; the scene's environment lights it. Only its node moves it.
In a scene, camera2d is the node key that applies it. A script reaches each property below as a field on node.camera2d: reading one asks the running component, and assigning one leaves the rest alone. The whole table is node.camera2d.get() and node.camera2d.set(table).
Properties
| property | type | default | description |
|---|---|---|---|
current |
bool | true |
Whether this camera drives the view; the last current one wins |
effects |
asset · camera_effects |
— | The passes the frame resolves through and how each is tuned; empty draws the frame as it is |
hidpi |
bool | true |
Count pixels_per_unit in logical pixels, multiplied by the display's scale; off counts physical pixels, for pixel art that should land on the screen's own grid |
pixels_per_unit |
float | 60 |
Zoom in logical pixels per world unit At least 0.01. |
Asset types this component references: camera_effects.