- Camera runtime API functions.
Static methods
staticgetAspectRatio(camera:HashOrStringOrUrl):Float
- Gets the effective aspect ratio of the camera.
If auto aspect ratio is enabled, returns the aspect ratio calculated from the current render target. Otherwise returns the manually set aspect ratio.
Parameters:
camera | camera id |
|---|
Returns:
the effective aspect ratio
staticgetAutoAspectRatio(camera:HashOrStringOrUrl):Bool
- Returns whether auto aspect ratio calculation is enabled.
When enabled, the camera automatically calculates aspect ratio from render target dimensions. When disabled, uses the manually set aspect ratio value.
Parameters:
camera | camera id |
|---|
Returns:
true if auto aspect ratio is enabled
staticgetCameras():Table<Any, Url>
- Returns all camera URLs registered in the render context.
Returns:
a table with all camera URLs
staticgetEnabled(camera:HashOrStringOrUrl):Bool
- Returns true if a camera component is enabled.
Parameters:
camera |
|
|---|
Returns:
true if the camera is enabled
staticgetFarZ(camera:HashOrStringOrUrl):Float
- Returns the far z for the camera frustum.
Parameters:
camera | camera id |
|---|
Returns:
the far z
staticgetFov(camera:HashOrStringOrUrl):Float
- Returns the vertical field of view.
Parameters:
camera | camera id |
|---|
Returns:
the field of view
staticgetNearZ(camera:HashOrStringOrUrl):Float
- Returns the near z for the camera frustum.
Parameters:
camera | camera id |
|---|
Returns:
the near z
staticgetOrthographicMode(camera:HashOrStringOrUrl):CameraOrthoMode
- Returns the orthographic zoom mode.
Parameters:
camera | camera id |
|---|
Returns:
one of CameraOrthoMode values
staticgetOrthographicZoom(camera:HashOrStringOrUrl):Float
- Returns the orthographic zoom value.
Parameters:
camera | camera id |
|---|
Returns:
the orthographic zoom
staticgetProjection(camera:HashOrStringOrUrl):Matrix4
- Returns the calculated projection matrix.
Parameters:
camera | camera id |
|---|
Returns:
the projection matrix
staticgetView(camera:HashOrStringOrUrl):Matrix4
- Returns the calculated view matrix.
Parameters:
camera | camera id |
|---|
Returns:
the view matrix
staticsetAspectRatio(camera:HashOrStringOrUrl, aspect_ratio:Float):Void
- Sets the manual aspect ratio for the camera.
This value is only used when auto aspect ratio is disabled.
Parameters:
camera | camera id |
|---|---|
aspect_ratio | the manual aspect ratio value |
staticsetAutoAspectRatio(camera:HashOrStringOrUrl, auto:Bool):Void
- Enables or disables automatic aspect ratio calculation.
When enabled (true), the camera automatically calculates aspect ratio from render target dimensions. When disabled (false), uses the manually set aspect ratio value.
Parameters:
camera | camera id |
|---|---|
auto | true to enable auto aspect ratio |
staticsetFarZ(camera:HashOrStringOrUrl, far_z:Float):Void
- Sets the far z of the camera frustum.
Parameters:
camera | camera id |
|---|---|
far_z | the far z |
staticsetFov(camera:HashOrStringOrUrl, fov:Float):Void
- Sets the vertical field of view.
Parameters:
camera | camera id |
|---|---|
fov | the field of view |
staticsetNearZ(camera:HashOrStringOrUrl, near_z:Float):Void
- Sets the near z of the camera frustum.
Parameters:
camera | camera id |
|---|---|
near_z | the near z |
staticsetOrthographicMode(camera:HashOrStringOrUrl, mode:CameraOrthoMode):Void
- Sets the orthographic zoom mode.
Parameters:
camera | camera id |
|---|---|
mode | one of CameraOrthoMode values |
staticsetOrthographicZoom(camera:HashOrStringOrUrl, zoom:Float):Void
- Sets the orthographic zoom value.
Parameters:
camera | camera id |
|---|---|
zoom | the orthographic zoom value |