SceneCamera
class in OpalScript
Named camera framing, tracking and simultaneous screen views, with editor preview guides.
Properties
| Member | Description |
|---|---|
| SceneCamera.Zoom | Current camera zoom; live during Play and authored otherwise. |
| SceneCamera.Following | Whether following is enabled for this camera during Play. |
| SceneCamera.Position | Camera center in world units, before screen shake. |
Methods
| Member | Description |
|---|---|
| SceneCamera.SetZoom | Set this camera's zoom multiplier. |
| SceneCamera.ClearFollow | Clear this camera's follow target. |
| SceneCamera.ResetView | Reset zoom and tracking. Return to the camera object's world position during Play, or stage center in Arrange. |
| SceneCamera.Follow | Follow a scene entity during Play. |
| SceneCamera.ZoomTo | Ease to a zoom on this camera using game time. |
| SceneCamera.Focus | Frame a target at its world position without enabling follow. |
| SceneCamera.MoveTo | Move this camera to a world position and zoom over the supplied seconds. |
| SceneCamera.Activate | Use this camera for the primary view during Play. |
| SceneCamera.Shake | Shake this view over game time, respecting reduced motion. |
| SceneCamera.StopMotion | Cancel movement, following and shake at the current camera pose. |
| SceneCamera.WorldToScreen | Project through this camera's current resolved output into canvas CSS pixels. |
| SceneCamera.ScreenToWorld | Convert canvas CSS pixels through this camera's current resolved output. |
| SceneCamera.IsDefault | Whether this is the default scene camera. |
| SceneCamera.HasFollowTarget | Whether a follow target is assigned. |
Events
| Member | Description |
|---|---|
| SceneCamera.moveCompleted | Emitted when this camera finishes a move or zoom, with the resulting view and target identity. |
| SceneCamera.moveCancelled | Emitted when a camera move is interrupted or stopped; carries the pose at cancellation and its reason. |
| SceneCamera.shakeCompleted | Emitted when this camera's shake ends, including when reduced motion skips it. |