Trigger API Reference DCEI Functions Camera0 - funovus/editor-wiki 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 SetEnabledCameraClampForPlayer(int player, bool set)](#void-setenabledcameraclampforplayerint-player-bool-set)
* [void SetCameraFocusUnit(unit unit, float delay, float offsetX, float offsetY)](#void-setcamerafocusunitunit-unit-float-delay-float-offsetx-float-offsety)
* [void ClearCameraFocusUnit()](#void-clearcamerafocusunit)
* [void SetCameraFocusUnitForPlayer(int player, unit unit, float delay, float offsetX, float offsetY)](#void-setcamerafocusunitforplayerint-player-unit-unit-float-delay-float-offsetx-float-offsety)
* [void ClearCameraFocusUnitForPlayer(int player)](#void-clearcamerafocusunitforplayerint-player)
* [void SetCameraFocus(float x, float y, float duration, bool useRealTime)](#void-setcamerafocusfloat-x-float-y-float-duration-bool-userealtime)
* [void SetCameraFocusWithGameTime(float x, float y, float duration, bool useRealTime)](#void-setcamerafocuswithgametimefloat-x-float-y-float-duration-bool-userealtime)
* [void SetCameraFocusSmoothOvertimeForPlayer(int player, float x, float y, float duration, bool useRealTime)](#void-setcamerafocussmoothovertimeforplayerint-player-float-x-float-y-float-duration-bool-userealtime)
* [void SetCameraFocusSmoothOvertimeForPlayerWithGameTime(int player, float x, float y, float duration, bool useRealTime)](#void-setcamerafocussmoothovertimeforplayerwithgametimeint-player-float-x-float-y-float-duration-bool-userealtime)
* [void SetCameraDistance(float targetDistance, float duration, bool useRealTime)](#void-setcameradistancefloat-targetdistance-float-duration-bool-userealtime)
* [void SetCameraDistanceWithGameTime(float targetDistance, float duration, bool useRealTime)](#void-setcameradistancewithgametimefloat-targetdistance-float-duration-bool-userealtime)
* [void SetCameraOrthographicSize(float targetSize, float duration, bool useRealTime)](#void-setcameraorthographicsizefloat-targetsize-float-duration-bool-userealtime)
* [void SetCameraOrthographicSizeWithGameTime(float targetSize, float duration, bool useRealTime)](#void-setcameraorthographicsizewithgametimefloat-targetsize-float-duration-bool-userealtime)
* [void SetCameraMaxOrthographicSize(float targetSize)](#void-setcameramaxorthographicsizefloat-targetsize)
* [float GetCameraOrthographicSize()](#float-getcameraorthographicsize)
* [void SetCameraDistanceSmoothOvertimeForPlayer(int player, float targetDistance, float duration, bool useRealTime)](#void-setcameradistancesmoothovertimeforplayerint-player-float-targetdistance-float-duration-bool-userealtime)
* [void SetCameraDistanceSmoothOvertimeForPlayerWithGameTime(int player, float targetDistance, float duration, bool useRealTime)](#void-setcameradistancesmoothovertimeforplayerwithgametimeint-player-float-targetdistance-float-duration-bool-userealtime)
* [void SetCameraPitchSmoothOvertime(float targetPitchDeg, float duration, bool useRealTime)](#void-setcamerapitchsmoothovertimefloat-targetpitchdeg-float-duration-bool-userealtime)
* [void SetCameraPitchSmoothOvertimeWithGameTime(float targetPitchDeg, float duration, bool useRealTime)](#void-setcamerapitchsmoothovertimewithgametimefloat-targetpitchdeg-float-duration-bool-userealtime)
* [void SetCameraPitchSmoothOvertimeForPlayer(int player, float targetPitchDeg, float duration, bool useRealTime)](#void-setcamerapitchsmoothovertimeforplayerint-player-float-targetpitchdeg-float-duration-bool-userealtime)
* [void SetCameraPitchSmoothOvertimeForPlayerWithGameTime(int player, float targetPitchDeg, float duration, bool useRealTime)](#void-setcamerapitchsmoothovertimeforplayerwithgametimeint-player-float-targetpitchdeg-float-duration-bool-userealtime)
* [void SetCameraYawSmoothOvertime(float targetYawDeg, float duration, bool useRealTime)](#void-setcamerayawsmoothovertimefloat-targetyawdeg-float-duration-bool-userealtime)
* [void SetCameraYawSmoothOvertimeWithGameTime(float targetYawDeg, float duration, bool useRealTime)](#void-setcamerayawsmoothovertimewithgametimefloat-targetyawdeg-float-duration-bool-userealtime)
* [void SetCameraYawSmoothOvertimeForPlayer(int player, float targetYawDeg, float duration, bool useRealTime)](#void-setcamerayawsmoothovertimeforplayerint-player-float-targetyawdeg-float-duration-bool-userealtime)
* [void SetCameraYawSmoothOvertimeForPlayerWithGameTime(int player, float targetYawDeg, float duration, bool useRealTime)](#void-setcamerayawsmoothovertimeforplayerwithgametimeint-player-float-targetyawdeg-float-duration-bool-userealtime)
* [float GetCameraPitch()](#float-getcamerapitch)
* [float GetCameraYaw()](#float-getcamerayaw)
* [float GetCameraMaxDistance()](#float-getcameramaxdistance)
* [float GetCameraMinDistance()](#float-getcameramindistance)
|
Trigger API Reference\DCEI Functions\Camera (1/2) {Trigger-API-ReferenceDCEI-FunctionsCamera-12}
void SetEnabledCameraClamp(bool set)
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.
DCEI.SetEnabledCameraClamp(true)
void SetEnabledCameraClampForPlayer(int player, bool set) {void-SetEnabledCameraClampForPlayerint-player-bool-set}
void SetEnabledCameraClampForPlayer(int player, bool set)
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.
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)
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.
-
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.
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)
void ClearCameraFocusUnit()
Removes any active camera focus.
DCEI.ClearCameraFocusUnit()
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)
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.
-
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.
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)
void ClearCameraFocusUnitForPlayer(int player)
Removes any active camera focus for the given player.
DCEI.ClearCameraFocusUnitForPlayer(1)
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)
Moves camera focus to the given coordinates.Use Game Time by default
-
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.
DCEI.SetCameraFocus(0, 16, 3, false)
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)
Moves camera focus to the given coordinates.Use Game Time by default
-
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.
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)
Moves camera focus to the given coordinates for the given player with game time. Only use in multiplayer
-
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.
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)
Moves camera focus to the given coordinates for the given player with game time. Only use in multiplayer
-
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.
void SetCameraDistance(float targetDistance, float duration, bool useRealTime) {void-SetCameraDistancefloat-targetDistance-float-duration-bool-useRealTime}
void SetCameraDistance(float targetDistance, float duration, bool useRealTime)
Sets the camera zoom distance with smooth transition under certain duration of time.
-
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.
DCEI.SetCameraDistance(15, 2, false)
void SetCameraDistanceWithGameTime(float targetDistance, float duration, bool useRealTime) {void-SetCameraDistanceWithGameTimefloat-targetDistance-float-duration-bool-useRealTime}
void SetCameraDistanceWithGameTime(float targetDistance, float duration, bool useRealTime)
Sets the camera zoom distance with smooth transition under certain duration of time.
-
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.
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)
Sets the camera's orthographic size. Note that this only works if the camera is set to orthographic mode in map settings.
-
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.
DCEI.SetCameraOrthographicSize(5, 2, true)
void SetCameraOrthographicSizeWithGameTime(float targetSize, float duration, bool useRealTime) {void-SetCameraOrthographicSizeWithGameTimefloat-targetSize-float-duration-bool-useRealTime}
void SetCameraOrthographicSizeWithGameTime(float targetSize, float duration, bool useRealTime)
Sets the camera's orthographic size. Note that this only works if the camera is set to orthographic mode in map settings.
-
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.
DCEI.SetCameraOrthographicSizeWithGameTime(5, 2, true)
void SetCameraMaxOrthographicSize(float targetSize) {void-SetCameraMaxOrthographicSizefloat-targetSize}
void SetCameraMaxOrthographicSize(float targetSize)
Sets the camera's max orthographic size. Note that this only works if the camera is set to orthographic mode in map settings.
DCEI.SetCameraMaxOrthographicSize(10)
float GetCameraOrthographicSize()
Returns the camera's orthographic size.
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)
Sets the camera zoom distance for the given player.
-
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.
DCEI.SetCameraDistanceSmoothOvertimeForPlayer(1, 15, 2, false)
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)
Sets the camera zoom distance for the given player.
-
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.
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)
-
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.
DCEI.SetCameraPitchSmoothOvertime(35, 2, false)
void SetCameraPitchSmoothOvertimeWithGameTime(float targetPitchDeg, float duration, bool useRealTime) {void-SetCameraPitchSmoothOvertimeWithGameTimefloat-targetPitchDeg-float-duration-bool-useRealTime}
void SetCameraPitchSmoothOvertimeWithGameTime(float targetPitchDeg, float duration, bool useRealTime)
-
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.
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)
Sets the camera pitch for the given player.
-
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.
DCEI.SetCameraPitchSmoothOvertimeForPlayer(1, 35, 2, false)
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)
Sets the camera pitch for the given player.
-
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.
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)
Sets the camera yaw to the given angle.
-
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.
DCEI.SetCameraYawSmoothOvertime(360, 4, false)
void SetCameraYawSmoothOvertimeWithGameTime(float targetYawDeg, float duration, bool useRealTime) {void-SetCameraYawSmoothOvertimeWithGameTimefloat-targetYawDeg-float-duration-bool-useRealTime}
void SetCameraYawSmoothOvertimeWithGameTime(float targetYawDeg, float duration, bool useRealTime)
Sets the camera yaw to the given angle.
-
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.
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)
Sets the camera yaw to the given angle for the given player.
-
int
player
the player to set the camera for. -
float
targetYawDeg
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.
DCEI.SetCameraYawSmoothOvertimeForPlayer(1, -360, 4, false)
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)
Sets the camera yaw to the given angle for the given player.
-
int
player
the player to set the camera for. -
float
targetYawDeg
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.
DCEI.SetCameraYawSmoothOvertimeForPlayer(1, -360, 4, false)
float GetCameraPitch()
DCEI.LogMessage(DCEI.GetCameraPitch())
float GetCameraYaw()
DCEI.LogMessage(DCEI.GetCameraYaw())
float GetCameraMaxDistance()
Returns the camera's maximum zoom distance.
DCEI.LogMessage(DCEI.GetCameraMaxDistance())
float GetCameraMinDistance()
Returns the camera's minimum zoom distance.
DCEI.LogMessage(DCEI.GetCameraMinDistance())