Class: CameraSetup#

Hierarchy#

  • Handle<camerasetup>

    ↳ CameraSetup

Constructors#

constructor#

new CameraSetup(): CameraSetup

Creates a new CameraSetup object.

Returns: CameraSetup

Defined in: handles/camera.ts:240

Properties#

handle#

• Readonly handle: camerasetup

Inherited from: Handle.handle

Defined in: handles/handle.ts:6

Accessors#

destPoint#

destPoint(): Point

Returns the target Point of a CameraSetup.

Returns: Point

Defined in: handles/camera.ts:251


destX#

destX(): number

Returns the target x-coordinate of a CameraSetup.

Returns: number

Defined in: handles/camera.ts:258

destX(x: number): void

Sets the target x-coordinate of a CameraSetup.

Parameters:#

NameType
xnumber

Returns: void

Defined in: handles/camera.ts:265


destY#

destY(): number

Returns the target y-coordinate of a CameraSetup.

Returns: number

Defined in: handles/camera.ts:272

destY(y: number): void

Sets the target y-coordinate of a CameraSetup.

Parameters:#

NameType
ynumber

Returns: void

Defined in: handles/camera.ts:279


id#

id(): number

Get the unique ID of the handle. The ID is recycled once you destroy the object.

Returns: number

The unique ID of a handle object.

Defined in: handles/handle.ts:18


label#

label(): string

Gets the label of a CameraSetup.

Returns: string

Defined in: handles/camera.ts:293

label(label: string): void

Sets the label of a CameraSetup.

Parameters:#

NameType
labelstring

Returns: void

Defined in: handles/camera.ts:286

Methods#

apply#

apply(doPan: boolean, panTimed: boolean): void

Applies the CameraSetup, altering the current camera's fields to match those of the camera setup.

Parameters:#

NameTypeDescription
doPanbooleanIf set to true, it will move the current camera's target coordinates to the camera setup's target coordinates. If false, the camera will not move coordinates, but will still apply the other fields.
panTimedbooleanIf set to true, then it will change the camera's properties over the times specified in CameraSetup.setField.

Returns: void

Defined in: handles/camera.ts:304


applyForceDuration#

applyForceDuration(doPan: boolean, forceDuration: number): void

Applies the camerasetup over a certain duration, altering the current camera's fields to match those of the camera setup.

Parameters:#

NameTypeDescription
doPanbooleanIf set to true, it will move the current camera's target coordinates to the camera setup's target coordinates. If false, the camera will not move coordinates, but will still apply the other fields.
forceDurationnumberThe duration it will take to apply all the camera fields. It will ignore the times set by CameraSetup.setField.

Returns: void

Defined in: handles/camera.ts:315


applyForceDurationSmooth#

applyForceDurationSmooth(doPan: boolean, forcedDuration: number, easeInDuration: number, easeOutDuration: number, smoothFactor: number): void

Parameters:#

NameTypeDescription
doPanbooleanIf set to true, it will move the current camera's target coordinates to the camera setup's target coordinates. If false, the camera will not move coordinates, but will still apply the other fields.
forcedDurationnumberThe duration it will take to apply all the camera fields. It will ignore the times set by CameraSetup.setField.
easeInDurationnumber
easeOutDurationnumber
smoothFactornumber

Returns: void

Defined in: handles/camera.ts:329


applyForceDurationZ#

applyForceDurationZ(zDestOffset: number, forceDuration: number): void

Applies the CameraSetup over a certain duration with a custom z-offset value, altering the current camera's fields to match those of the camera setup. The z-offset input will override the z-offset specified by CameraSetup.setField.

Parameters:#

NameTypeDescription
zDestOffsetnumberThe camera's z-offset will gradually change to this value over the specified duration.
forceDurationnumberThe duration it will take to apply all the camera fields. It will ignore the times set by CameraSetup.setField.

Returns: void

Defined in: handles/camera.ts:340


applyZ#

applyZ(zDestOffset: number): void

Applies the CameraSetup with a custom z-offset, altering the current camera's fields to match those of the camera setup. The z-offset input will override the z-offset specified by the CameraSetup through CameraSetup.setField.

bug If a player pauses the game after the CameraSetup has been applied, the z-offset of the game camera will change to the z-offset of the CameraSetup for that player.

Parameters:#

NameTypeDescription
zDestOffsetnumberThe camera's z-offset will gradually change to this value over the specified duration.

Returns: void

Defined in: handles/camera.ts:351


getField#

getField(whichField: camerafield): number

Returns the value of the specified field for a CameraSetup. The angle of attack, field of view, roll, and rotation are all returned in degrees, unlike Camera.getField.

note The angle of attack, field of view, roll, and rotation are all returned in degrees.

Parameters:#

NameTypeDescription
whichFieldcamerafieldThe field of the CameraSetup.

Returns: number

Defined in: handles/camera.ts:361


setDestPos#

setDestPos(x: number, y: number, duration: number): void

Sets the target coordinates for a CameraSetup over a duration. The coordinate change will only be applied when CameraSetup.apply (or some other variant) is ran.

Parameters:#

NameTypeDescription
xnumberThe target x-coordinate.
ynumberThe target y-coordinate.
durationnumberThe coordinates will be applied over this duration once the camera setup is applied.

Returns: void

Defined in: handles/camera.ts:372


setField#

setField(whichField: camerafield, value: number, duration: number): void

Assigns a value to the specified field for a CameraSetup. The input angles should be in degrees.

Parameters:#

NameTypeDescription
whichFieldcamerafieldThe field of the CameraSetup.
valuenumberThe value to assign to the field.
durationnumberThe duration over which the field will be set. If the duration is greater than 0, the changes will be made gradually once the camera setup is applied.

Returns: void

Defined in: handles/camera.ts:382


fromHandle#

static fromHandle(handle: camerasetup): camerasetup

Parameters:#

NameType
handlecamerasetup

Returns: camerasetup

Defined in: handles/camera.ts:386