Skip to content

SceneCamera ​

class in OpalScript

Named camera framing, tracking and simultaneous screen views, with editor preview guides.

Properties ​

MemberDescription
SceneCamera.ZoomCurrent camera zoom; live during Play and authored otherwise.
SceneCamera.FollowingWhether following is enabled for this camera during Play.
SceneCamera.PositionCamera center in world units, before screen shake.

Methods ​

MemberDescription
SceneCamera.SetZoomSet this camera's zoom multiplier.
SceneCamera.ClearFollowClear this camera's follow target.
SceneCamera.ResetViewReset zoom and tracking. Return to the camera object's world position during Play, or stage center in Arrange.
SceneCamera.FollowFollow a scene entity during Play.
SceneCamera.ZoomToEase to a zoom on this camera using game time.
SceneCamera.FocusFrame a target at its world position without enabling follow.
SceneCamera.MoveToMove this camera to a world position and zoom over the supplied seconds.
SceneCamera.ActivateUse this camera for the primary view during Play.
SceneCamera.ShakeShake this view over game time, respecting reduced motion.
SceneCamera.StopMotionCancel movement, following and shake at the current camera pose.
SceneCamera.WorldToScreenProject through this camera's current resolved output into canvas CSS pixels.
SceneCamera.ScreenToWorldConvert canvas CSS pixels through this camera's current resolved output.
SceneCamera.IsDefaultWhether this is the default scene camera.
SceneCamera.HasFollowTargetWhether a follow target is assigned.

Events ​

MemberDescription
SceneCamera.moveCompletedEmitted when this camera finishes a move or zoom, with the resulting view and target identity.
SceneCamera.moveCancelledEmitted when a camera move is interrupted or stopped; carries the pose at cancellation and its reason.
SceneCamera.shakeCompletedEmitted when this camera's shake ends, including when reduced motion skips it.

See also ​