Constructor
new CameraTargets()
Creates a new instance of CameraTargets.
- Source:
Members
(readonly) length :number
Number of display objects to follow.
Type:
- number
- Source:
(readonly) position :number
Destination point, ie. the position to which the camera should move.
Type:
- number
- Source:
Methods
add(target) → {undefined}
Add a target to follow.
Parameters:
| Name | Type | Description |
|---|---|---|
target |
rune.display.DisplayObject | Target to follow. |
- Source:
Returns:
- Type
- undefined
clear() → {undefined}
Clears all registered targets.
- Source:
Returns:
- Type
- undefined
getBounds(outputopt) → {rune.geom.Rectangle}
Calculates global axis-aligned bounds around all targets, including their
scaled width and height. Nested targets use their global positions. Empty
collections return an empty rectangle at the origin. Rotation and parent
scaling follow the same limitations as DisplayObject.getGlobalRect().
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
output |
rune.geom.Rectangle |
<optional> |
Optional rectangle to store the result in. |
- Source:
Returns:
Bounds of the target collection.
- Type
- rune.geom.Rectangle
remove(target) → {undefined}
Removes a registered target.
Parameters:
| Name | Type | Description |
|---|---|---|
target |
rune.display.DisplayObject | Target to remove. |
- Source:
Returns:
- Type
- undefined