Trigger API Reference DCEI Functions Camera0 - BLKTower/TestWiki GitHub Wiki
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
unitthe unit to focus the camera on. -
float
delaycontrols 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
offsetXthe X-axis offset from the unit for the camera focus. -
float
offsetYthe 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
playerthe player to set camera focus for. -
unit
unitthe unit to focus the camera on. -
float
delaycontrols 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
offsetXthe X-axis offset from the unit for the camera focus. -
float
offsetYthe 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)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
xthe X coordinate for the camera focus point. -
float
ythe Z coordinate for the camera focus point. -
float
durationthe 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
useRealTimeif 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)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
playerthe player to move the camera for. -
float
xthe X coordinate for the camera focus point. -
float
ythe Z coordinate for the camera focus point. -
float
durationthe 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
useRealTimeif 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)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
targetDistancethe amount of time the timer runs for. -
float
durationthe amount of time the timer runs for. -
bool
useRealTimeif 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)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
targetSizethe size of the orthographic camera. -
float
durationthe duration of the camera transition. -
bool
useRealTimeif 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)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
playerthe player to set the camera for. -
float
targetDistancethe distance for the camera. -
float
durationthe duration of the camera transition. A duration of 0 will cause the camera to instantly snap to the new distance. -
bool
useRealTimeif 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)void SetCameraPitchSmoothOvertimeWithGameTime(float targetPitchDeg, float duration, bool useRealTime) {void-SetCameraPitchSmoothOvertimeWithGameTimefloat-targetPitchDeg-float-duration-bool-useRealTime}
void SetCameraPitchSmoothOvertimeWithGameTime(float targetPitchDeg, float duration, bool useRealTime)-
float
targetPitchDegthe pitch of the camera. Acceptable values range from 11-90. Values over or under will be clamped. -
float
durationthe duration of the camera transition. A duration of 0 will cause the camera to instantly snap to the new pitch. -
bool
useRealTimeif 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)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
playerthe player to set the camera for. -
float
targetPitchDegthe pitch of the camera. Acceptable values range from 11-90. Values over or under will be clamped. -
float
durationthe duration of the camera transition. A duration of 0 will cause the camera to instantly snap to the new pitch. -
bool
useRealTimeif 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)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
targetPitchDegthe 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
durationthe duration of the camera transition. A duration of 0 will cause the camera to instantly snap to the new yaw. -
bool
useRealTimeif 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)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)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())