Class: CameraManager
Creates and updates camera components.
Constructors
Constructor
new CameraManager(): CameraManager;
Returns
CameraManager
Methods
Create()
static Create(entity): Promise<boolean>;
Creates a camera component on an entity.
Parameters
| Parameter | Type | Description |
|---|---|---|
entity | number | The Entity to update. |
Returns
Promise<boolean>
A promise that resolves to true if the camera component was
created, or false otherwise.
Destroy()
static Destroy(entity): Promise<boolean>;
Removes a camera component from an entity.
Parameters
| Parameter | Type | Description |
|---|---|---|
entity | number | The Entity to update. |
Returns
Promise<boolean>
A promise that resolves to true if the camera component was
removed, or false otherwise.
HasComponent()
static HasComponent(entity): Promise<boolean>;
Checks whether an entity has a camera component.
Parameters
| Parameter | Type | Description |
|---|---|---|
entity | number | The Entity to inspect. |
Returns
Promise<boolean>
A promise that resolves to true if the entity has a camera
component, or false otherwise.
SetEnabled()
static SetEnabled(entity, enabled): Promise<void>;
Sets whether a camera component is enabled.
Parameters
| Parameter | Type | Description |
|---|---|---|
entity | number | The Entity to update. |
enabled | boolean | Whether the camera component is enabled. |
Returns
Promise<void>
A promise that resolves when the enabled state has been changed.
GetEnabled()
static GetEnabled(entity): Promise<boolean>;
Gets whether a camera component is enabled.
Parameters
| Parameter | Type | Description |
|---|---|---|
entity | number | The Entity to inspect. |
Returns
Promise<boolean>
A promise that resolves to true if the camera component is
enabled, or false otherwise.
SetRenderTexture()
static SetRenderTexture(entity, renderTexture): Promise<void>;
Sets the render texture of a camera.
Parameters
| Parameter | Type | Description |
|---|---|---|
entity | number | The Entity to update. |
renderTexture | number | The Texture to assign as the render texture; it must be a render texture. |
Returns
Promise<void>
A promise that resolves when the render texture has been changed.
GetRenderTexture()
static GetRenderTexture(entity): Promise<number>;
Gets the render texture of a camera.
Parameters
| Parameter | Type | Description |
|---|---|---|
entity | number | The Entity to inspect. |
Returns
Promise<number>
A promise that resolves to the assigned Texture.
SetProjectionType()
static SetProjectionType(entity, projectionType): Promise<void>;
Sets the projection type of a camera.
Parameters
| Parameter | Type | Description |
|---|---|---|
entity | number | The Entity to update. |
projectionType | ProjectionType | The projection type to assign. |
Returns
Promise<void>
A promise that resolves when the projection type has been changed.
GetProjectionType()
static GetProjectionType(entity): Promise<ProjectionType>;
Gets the projection type of a camera.
Parameters
| Parameter | Type | Description |
|---|---|---|
entity | number | The Entity to inspect. |
Returns
Promise<ProjectionType>
A promise that resolves to the projection type.
SetFieldOfView()
static SetFieldOfView(entity, fov): Promise<void>;
Sets the field of view of a camera in degrees.
Parameters
| Parameter | Type | Description |
|---|---|---|
entity | number | The Entity to update. |
fov | number | The field of view in degrees. |
Returns
Promise<void>
A promise that resolves when the field of view has been changed.
GetFieldOfView()
static GetFieldOfView(entity): Promise<number>;
Gets the field of view of a camera in degrees.
Parameters
| Parameter | Type | Description |
|---|---|---|
entity | number | The Entity to inspect. |
Returns
Promise<number>
A promise that resolves to the field of view in degrees.
SetOrthographicSize()
static SetOrthographicSize(entity, orthographicSize): Promise<void>;
Sets the orthographic size of a camera.
This value is used when the projection type is ProjectionType.Orthographic.
Parameters
| Parameter | Type | Description |
|---|---|---|
entity | number | The Entity to update. |
orthographicSize | number | The orthographic size. |
Returns
Promise<void>
A promise that resolves when the orthographic size has been changed.
GetOrthographicSize()
static GetOrthographicSize(entity): Promise<number>;
Gets the orthographic size of a camera.
Parameters
| Parameter | Type | Description |
|---|---|---|
entity | number | The Entity to inspect. |
Returns
Promise<number>
A promise that resolves to the orthographic size.
SetNearClipPlane()
static SetNearClipPlane(entity, nearClipPlane): Promise<void>;
Sets the near clip plane distance of a camera.
Parameters
| Parameter | Type | Description |
|---|---|---|
entity | number | The Entity to update. |
nearClipPlane | number | The near clip plane distance. |
Returns
Promise<void>
A promise that resolves when the near clip plane has been changed.
GetNearClipPlane()
static GetNearClipPlane(entity): Promise<number>;
Gets the near clip plane distance of a camera.
Parameters
| Parameter | Type | Description |
|---|---|---|
entity | number | The Entity to inspect. |
Returns
Promise<number>
A promise that resolves to the near clip plane distance.
SetFarClipPlane()
static SetFarClipPlane(entity, farClipPlane): Promise<void>;
Sets the far clip plane distance of a camera.
Parameters
| Parameter | Type | Description |
|---|---|---|
entity | number | The Entity to update. |
farClipPlane | number | The far clip plane distance. |
Returns
Promise<void>
A promise that resolves when the far clip plane has been changed.
GetFarClipPlane()
static GetFarClipPlane(entity): Promise<number>;
Gets the far clip plane distance of a camera.
Parameters
| Parameter | Type | Description |
|---|---|---|
entity | number | The Entity to inspect. |
Returns
Promise<number>
A promise that resolves to the far clip plane distance.