Constructor
new Cameras(input)
Creates a new Cameras instance.
Parameters:
Name | Type | Description |
---|---|---|
input |
rune.display.Stage | What the camera system should render. |
- Source:
Members
(readonly) length :number
Returns the number of available cameras.
Type:
- number
- Source:
Methods
addCamera(camera) → {rune.camera.Camera}
Adds a Camera instance to this Cameras instance.
Parameters:
Name | Type | Description |
---|---|---|
camera |
rune.camera.Camera | The camera to add. |
- Source:
Throws:
-
If no valid camera object.
- Type
- TypeError
Returns:
- Type
- rune.camera.Camera
createCamera(xopt, yopt, widthopt, heightopt) → {rune.camera.Camera}
Creates a new Camera instance.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
x |
number |
<optional> |
0 | Camera position in x coordinates. |
y |
number |
<optional> |
0 | Camera position in y coordinates. |
width |
number |
<optional> |
384 | Camera size in width. |
height |
number |
<optional> |
216 | Camera size in height. |
- Source:
Returns:
The new camera object.
- Type
- rune.camera.Camera
getCameraAt(index) → {rune.camera.Camera}
Returns the camera object instance that exists at the specified index.
Parameters:
Name | Type | Description |
---|---|---|
index |
number | The index position of the camera object. |
- Source:
Throws:
-
Throws if the index does not exist in the camera list.
- Type
- RangeError
Returns:
- Type
- rune.camera.Camera
getCameras() → {Array.<rune.camera.Camera>}
Returns all Camera instances. Note that this method is primarily intended
for internal use.
- Source:
Returns:
- Type
- Array.<rune.camera.Camera>
removeCamera(camera, disposeopt) → {rune.camera.Camera}
Removes a specific Camera instance.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
camera |
rune.camera.Camera | Camera to remove. | ||
dispose |
boolean |
<optional> |
false | If the Camera instance is to be completely removed from memory. |
- Source:
Throws:
-
If invalid camera object.
- Type
- TypeError
Returns:
- Type
- rune.camera.Camera
removeCameras(disposeopt) → {undefined}
Removes all Camera instances.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
dispose |
boolean |
<optional> |
false | If the Camera instances are to be completely removed from memory. |
- Source:
Returns:
- Type
- undefined