Trigger API Reference DCEI Functions Camera0 - BLKTower/TestWiki GitHub Wiki

Table of Contents

Trigger API Reference\DCEI Functions\Camera (1/2) {Trigger-API-ReferenceDCEI-FunctionsCamera-12}

void SetEnabledCameraClamp(bool set) {void-SetEnabledCameraClampbool-set}

void SetEnabledCameraClamp(bool set)

Description

Toggles camera clamping. When clamped, camera movement will be restricted to inside the red square border displayed in the Terrain Window. In order to move the camera outside of this square, the camera must be unclamped first.

Parameters

  • bool set if true, enables camera clamping.

Example Usage

DCEI.SetEnabledCameraClamp(true)

void SetEnabledCameraClampForPlayer(int player, bool set) {void-SetEnabledCameraClampForPlayerint-player-bool-set}

void SetEnabledCameraClampForPlayer(int player, bool set)

Description

Toggles camera clamping for the given player. When clamped, camera movement will be restricted to inside the red square border displayed in the Terrain Window. In order to move the camera outside of this square, the camera must be unclamped first.

Parameters

  • int player the player to set camera clamping for.
  • bool set if true, enables camera clamping.

Example Usage

DCEI.SetEnabledCameraClampForPlayer(1, true)

void SetCameraFocusUnit(unit unit, float delay, float offsetX, float offsetY) {void-SetCameraFocusUnitunit-unit-float-delay-float-offsetX-float-offsetY}

void SetCameraFocusUnit(unit unit, float delay, float offsetX, float offsetY)

Description

Sets a persistent camera focus on the given unit. Does not override previous focus, use ClearCameraFocusUnit() to clear previous focus before setting a new focus.

Parameters

  • unit unit the unit to focus the camera on.
  • float delay controls how long the camera takes to recenter on the unit if it is manually moved. A delay of 0 will cause the camera to instantly snap back.
  • float offsetX the X-axis offset from the unit for the camera focus.
  • float offsetY the Z-axis offset from the unit for the camera focus.

Example Usage

local team_id = 1
local player_id = 1
local unit_type = "Standard MeleeUnit"
local x, y = 16, 16
local unit = DCEI.CreateUnit(team_id, player_id, unit_type, x, y)

DCEI.SetCameraFocusUnit(unit, 3, 5, 5)

Related

void ClearCameraFocusUnit() {void-ClearCameraFocusUnit}

void ClearCameraFocusUnit()

Description

Removes any active camera focus.

Example Usage

DCEI.ClearCameraFocusUnit()

Related

void SetCameraFocusUnitForPlayer(int player, unit unit, float delay, float offsetX, float offsetY) {void-SetCameraFocusUnitForPlayerint-player-unit-unit-float-delay-float-offsetX-float-offsetY}

void SetCameraFocusUnitForPlayer(int player, unit unit, float delay, float offsetX, float offsetY)

Description

Sets a persistent camera focus on the given unit for the given player. Does not override previous focus, use ClearCameraFocusUnitForPlayer() to clear previous focus before setting a new focus.

Parameters

  • int player the player to set camera focus for.
  • unit unit the unit to focus the camera on.
  • float delay controls how long the camera takes to recenter on the unit if it is manually moved. A delay of 0 will cause the camera to instantly snap back.
  • float offsetX the X-axis offset from the unit for the camera focus.
  • float offsetY the Z-axis offset from the unit for the camera focus.

Example Usage

local team_id = 1
local player_id = 1
local unit_type = "Standard MeleeUnit"
local x, y = 16, 16
local unit = DCEI.CreateUnit(team_id, player_id, unit_type, x, y)

DCEI.SetCameraFocusUnitForPlayer(1, unit, 3, 5, 5)

Related

void ClearCameraFocusUnitForPlayer(int player) {void-ClearCameraFocusUnitForPlayerint-player}

void ClearCameraFocusUnitForPlayer(int player)

Description

Removes any active camera focus for the given player.

Parameters

  • int player the player to clear the camera focus for.

Example Usage

DCEI.ClearCameraFocusUnitForPlayer(1)

Related

void SetCameraFocus(float x, float y, float duration, bool useRealTime) {void-SetCameraFocusfloat-x-float-y-float-duration-bool-useRealTime}

void SetCameraFocus(float x, float y, float duration, bool useRealTime)

Description

Parameters

Example Usage

void SetCameraFocusWithGameTime(float x, float y, float duration, bool useRealTime) {void-SetCameraFocusWithGameTimefloat-x-float-y-float-duration-bool-useRealTime}

void SetCameraFocusWithGameTime(float x, float y, float duration, bool useRealTime)

⚠️Warning⚠️: This api was deprecated at 7/19/2022, and will be removed after 90 days.

Description

Moves camera focus to the given coordinates.Use Game Time by default

Parameters

  • float x the X coordinate for the camera focus point.
  • float y the Z coordinate for the camera focus point.
  • float duration the duration of the camera transition to the given point. A duration of 0 will cause the camera to instantly snap to the given point.
  • bool useRealTime if true, the duration is tracked via real time.

Example Usage

DCEI.SetCameraFocusWithGameTime(0, 16, 3, false)

void SetCameraFocusSmoothOvertimeForPlayer(int player, float x, float y, float duration, bool useRealTime) {void-SetCameraFocusSmoothOvertimeForPlayerint-player-float-x-float-y-float-duration-bool-useRealTime}

void SetCameraFocusSmoothOvertimeForPlayer(int player, float x, float y, float duration, bool useRealTime)

Description

Parameters

Example Usage

void SetCameraFocusSmoothOvertimeForPlayerWithGameTime(int player, float x, float y, float duration, bool useRealTime) {void-SetCameraFocusSmoothOvertimeForPlayerWithGameTimeint-player-float-x-float-y-float-duration-bool-useRealTime}

void SetCameraFocusSmoothOvertimeForPlayerWithGameTime(int player, float x, float y, float duration, bool useRealTime)

⚠️Warning⚠️: This api was deprecated at 7/19/2022, and will be removed after 90 days.

Description

Moves camera focus to the given coordinates for the given player with game time. Only use in multiplayer

Parameters

  • int player the player to move the camera for.
  • float x the X coordinate for the camera focus point.
  • float y the Z coordinate for the camera focus point.
  • float duration the duration of the camera transition to the given point. A duration of 0 will cause the camera to instantly snap to the given point.
  • bool useRealTime if true, the duration is tracked via real time.

Example Usage

void SetCameraDistance(float targetDistance, float duration, bool useRealTime) {void-SetCameraDistancefloat-targetDistance-float-duration-bool-useRealTime}

void SetCameraDistance(float targetDistance, float duration, bool useRealTime)

Description

Parameters

Example Usage

void SetCameraDistanceWithGameTime(float targetDistance, float duration, bool useRealTime) {void-SetCameraDistanceWithGameTimefloat-targetDistance-float-duration-bool-useRealTime}

void SetCameraDistanceWithGameTime(float targetDistance, float duration, bool useRealTime)

⚠️Warning⚠️: This api was deprecated at 7/19/2022, and will be removed after 90 days.

Description

Sets the camera zoom distance with smooth transition under certain duration of time.

Parameters

  • float targetDistance the amount of time the timer runs for.
  • float duration the amount of time the timer runs for.
  • bool useRealTime if true, uses real time instead of game time.

Example Usage

DCEI.SetCameraDistanceWithGameTime(15, 2, false)

void SetCameraOrthographicSize(float targetSize, float duration, bool useRealTime) {void-SetCameraOrthographicSizefloat-targetSize-float-duration-bool-useRealTime}

void SetCameraOrthographicSize(float targetSize, float duration, bool useRealTime)

Description

Parameters

Example Usage

void SetCameraOrthographicSizeWithGameTime(float targetSize, float duration, bool useRealTime) {void-SetCameraOrthographicSizeWithGameTimefloat-targetSize-float-duration-bool-useRealTime}

void SetCameraOrthographicSizeWithGameTime(float targetSize, float duration, bool useRealTime)

⚠️Warning⚠️: This api was deprecated at 7/19/2022, and will be removed after 90 days.

Description

Sets the camera's orthographic size. Note that this only works if the camera is set to orthographic mode in map settings.

Parameters

  • float targetSize the size of the orthographic camera.
  • float duration the duration of the camera transition.
  • bool useRealTime if true, the duration is tracked via real time.

Example Usage

DCEI.SetCameraOrthographicSizeWithGameTime(5, 2, true)

void SetCameraMaxOrthographicSize(float targetSize) {void-SetCameraMaxOrthographicSizefloat-targetSize}

void SetCameraMaxOrthographicSize(float targetSize)

Description

Sets the camera's max orthographic size. Note that this only works if the camera is set to orthographic mode in map settings.

Parameters

  • float targetSize the max size of the orthographic camera.

Example Usage

DCEI.SetCameraMaxOrthographicSize(10)

float GetCameraOrthographicSize() {float-GetCameraOrthographicSize}

float GetCameraOrthographicSize()

Description

Returns the camera's orthographic size.

Example Usage

DCEI.LogMessage(DCEI.GetCameraOrthographicSize())

void SetCameraDistanceSmoothOvertimeForPlayer(int player, float targetDistance, float duration, bool useRealTime) {void-SetCameraDistanceSmoothOvertimeForPlayerint-player-float-targetDistance-float-duration-bool-useRealTime}

void SetCameraDistanceSmoothOvertimeForPlayer(int player, float targetDistance, float duration, bool useRealTime)

Description

Parameters

Example Usage

void SetCameraDistanceSmoothOvertimeForPlayerWithGameTime(int player, float targetDistance, float duration, bool useRealTime) {void-SetCameraDistanceSmoothOvertimeForPlayerWithGameTimeint-player-float-targetDistance-float-duration-bool-useRealTime}

void SetCameraDistanceSmoothOvertimeForPlayerWithGameTime(int player, float targetDistance, float duration, bool useRealTime)

⚠️Warning⚠️: This api was deprecated at 7/19/2022, and will be removed after 90 days.

Description

Sets the camera zoom distance for the given player.

Parameters

  • int player the player to set the camera for.
  • float targetDistance the distance for the camera.
  • float duration the duration of the camera transition. A duration of 0 will cause the camera to instantly snap to the new distance.
  • bool useRealTime if true, the duration is tracked via real time.

Example Usage

DCEI.SetCameraDistanceSmoothOvertimeForPlayerWithGameTime(1, 15, 2, false)

void SetCameraPitchSmoothOvertime(float targetPitchDeg, float duration, bool useRealTime) {void-SetCameraPitchSmoothOvertimefloat-targetPitchDeg-float-duration-bool-useRealTime}

void SetCameraPitchSmoothOvertime(float targetPitchDeg, float duration, bool useRealTime)

Description

Parameters

Example Usage

void SetCameraPitchSmoothOvertimeWithGameTime(float targetPitchDeg, float duration, bool useRealTime) {void-SetCameraPitchSmoothOvertimeWithGameTimefloat-targetPitchDeg-float-duration-bool-useRealTime}

void SetCameraPitchSmoothOvertimeWithGameTime(float targetPitchDeg, float duration, bool useRealTime)

⚠️Warning⚠️: This api was deprecated at 7/19/2022, and will be removed after 90 days.

Description

Sets the camera pitch.

Parameters

  • float targetPitchDeg the pitch of the camera. Acceptable values range from 11-90. Values over or under will be clamped.
  • float duration the duration of the camera transition. A duration of 0 will cause the camera to instantly snap to the new pitch.
  • bool useRealTime if true, the duration is tracked via real time.

Example Usage

DCEI.SetCameraPitchSmoothOvertimeWithGameTime(35, 2, false)

void SetCameraPitchSmoothOvertimeForPlayer(int player, float targetPitchDeg, float duration, bool useRealTime) {void-SetCameraPitchSmoothOvertimeForPlayerint-player-float-targetPitchDeg-float-duration-bool-useRealTime}

void SetCameraPitchSmoothOvertimeForPlayer(int player, float targetPitchDeg, float duration, bool useRealTime)

Description

Parameters

Example Usage

void SetCameraPitchSmoothOvertimeForPlayerWithGameTime(int player, float targetPitchDeg, float duration, bool useRealTime) {void-SetCameraPitchSmoothOvertimeForPlayerWithGameTimeint-player-float-targetPitchDeg-float-duration-bool-useRealTime}

void SetCameraPitchSmoothOvertimeForPlayerWithGameTime(int player, float targetPitchDeg, float duration, bool useRealTime)

⚠️Warning⚠️: This api was deprecated at 7/19/2022, and will be removed after 90 days.

Description

Sets the camera pitch for the given player.

Parameters

  • int player the player to set the camera for.
  • float targetPitchDeg the pitch of the camera. Acceptable values range from 11-90. Values over or under will be clamped.
  • float duration the duration of the camera transition. A duration of 0 will cause the camera to instantly snap to the new pitch.
  • bool useRealTime if true, the duration is tracked via real time.

Example Usage

DCEI.SetCameraPitchSmoothOvertimeForPlayerWithGameTime(1, 35, 2, false)

void SetCameraYawSmoothOvertime(float targetYawDeg, float duration, bool useRealTime) {void-SetCameraYawSmoothOvertimefloat-targetYawDeg-float-duration-bool-useRealTime}

void SetCameraYawSmoothOvertime(float targetYawDeg, float duration, bool useRealTime)

Description

Parameters

Example Usage

void SetCameraYawSmoothOvertimeWithGameTime(float targetYawDeg, float duration, bool useRealTime) {void-SetCameraYawSmoothOvertimeWithGameTimefloat-targetYawDeg-float-duration-bool-useRealTime}

void SetCameraYawSmoothOvertimeWithGameTime(float targetYawDeg, float duration, bool useRealTime)

⚠️Warning⚠️: This api was deprecated at 7/19/2022, and will be removed after 90 days.

Description

Sets the camera yaw to the given angle.

Parameters

  • float targetPitchDeg the yaw of the camera in degrees. A positive value produces a clockwise spin, while a negative value produces a counterclockwise spin. This value is not capped. Excessively high values with short durations may be inadvisable.
  • float duration the duration of the camera transition. A duration of 0 will cause the camera to instantly snap to the new yaw.
  • bool useRealTime if true, the duration is tracked via real time.

Example Usage

DCEI.SetCameraYawSmoothOvertime(360, 4, false)

void SetCameraYawSmoothOvertimeForPlayer(int player, float targetYawDeg, float duration, bool useRealTime) {void-SetCameraYawSmoothOvertimeForPlayerint-player-float-targetYawDeg-float-duration-bool-useRealTime}

void SetCameraYawSmoothOvertimeForPlayer(int player, float targetYawDeg, float duration, bool useRealTime)

Description

Parameters

Example Usage

void SetCameraYawSmoothOvertimeForPlayerWithGameTime(int player, float targetYawDeg, float duration, bool useRealTime) {void-SetCameraYawSmoothOvertimeForPlayerWithGameTimeint-player-float-targetYawDeg-float-duration-bool-useRealTime}

void SetCameraYawSmoothOvertimeForPlayerWithGameTime(int player, float targetYawDeg, float duration, bool useRealTime)

⚠️Warning⚠️: This api was deprecated at 7/19/2022, and will be removed after 90 days.

Description

Parameters

Example Usage

float GetCameraPitch() {float-GetCameraPitch}

float GetCameraPitch()

Description

Returns the camera pitch.

Example Usage

DCEI.LogMessage(DCEI.GetCameraPitch())

float GetCameraYaw() {float-GetCameraYaw}

float GetCameraYaw()

Description

Returns the camera yaw.

Example Usage

DCEI.LogMessage(DCEI.GetCameraYaw())

float GetCameraMaxDistance() {float-GetCameraMaxDistance}

float GetCameraMaxDistance()

Description

Returns the camera's maximum zoom distance.

Example Usage

DCEI.LogMessage(DCEI.GetCameraMaxDistance())

float GetCameraMinDistance() {float-GetCameraMinDistance}

float GetCameraMinDistance()

Description

Returns the camera's minimum zoom distance.

Example Usage

DCEI.LogMessage(DCEI.GetCameraMinDistance())

⚠️ **GitHub.com Fallback** ⚠️