- Trigger API Reference\DCEI Functions\UI
- ShowFeedbackMessage
- ShowSystemUi
- ShowUnitStatusUi
- ShowUnitStatusUiForPlayer
- SetUnitHealthBarUiScale
- SetGoldRewardTextScale
- ShowSpeechBubble
- ShowSpeechBubble
- ShowUnitLabel
- ShowUnitLabel
- HideUnitLabel
- ShowFloatingText
- ShowFloatingText
- ShowFloatingTextWithOptions
- ShowFloatingTextAtUnit
- HideSpeechBubble
- ShowUnitStatusUiInSlot
- HideUnitStatusUi
- HideUnitStatusUiForPlayer
- ShowMessageWithButtonText
- ShowBigHeadMessage
- ShowBigHeadMessage
- HideBigHeadMessage
- ShowScreenMask
- HideScreenMask
- TakeScreenShot
- TakeScreenShotWildSky
- DeleteScreenShot
- ShowSlowMotionEffect
- HideSlowMotionEffect
Trigger API Reference\DCEI Functions\UI
void ShowFeedbackMessage(string message)
void ShowFeedbackMessage(string message)
Description
Shows a in-game feedback message in the center of the player's screen.
Parameters
- string
message
the message to display.
Example Usage
-- Creates a button
local button_layout = GMUI.Layout.New({
parent = DCEI.GetUiRootFrame(),
name = "Standard/Button/Button",
})
-- Sets the button to show the feedback message
DCEI.SetOnClickCallback(button_layout.Button, function()
DCEI.ShowFeedbackMessage("Message")
end)
void ShowSystemUi(int typeId)
void ShowSystemUi(int typeId)
Description
Shows a specific built-in UI frame. These UI frames are shown by default.
Parameters
- int
typeId
accepted values:
0
for wave indicator
1
for gold display
2
for speed up button
Example Usage
-- Hides the wave and gold UI
DCEI.HideSystemUi(0)
DCEI.HideSystemUi(1)
-- Creates a button
local button_layout = GMUI.Layout.New({
parent = DCEI.GetUiRootFrame(),
name = "Standard/Button/Button",
})
-- Sets the button to show the wave and gold UI
DCEI.SetOnClickCallback(button_layout.Button, function()
DCEI.ShowSystemUi(0)
DCEI.ShowSystemUi(1)
end)
void ShowUnitStatusUi(int id, unit unit)
void ShowUnitStatusUi(int id, unit unit)
Description
Shows the built-in status UI for the given unit.
Parameters
- int
id
the status UI to show. List of values.
2 - Large HP bar
3 - Slightly larger than default HP bar, bottom right corner "hero unit" UI
4 - Animated big hand pointer at the unit
5 - Top center HP bar with percent current HP
6 - Default speech bubble
7 - Nothing
8 - Yellow boxes/resource bar
9 - Yellow boxes as HP bar
10 - Nothing
11 - Top center HP bar with fractional current HP
- unit
unit
the unit to show the status UI for.
Example Usage
-- Creates the unit
local team_id = 1
local player_id = 1
local unit_type = DCEI.Unit("Standard MeleeUnit")
local x, z = 16, 16
local unit_instance = DCEI.CreateUnit(team_id, player_id, unit_type, x, z)
-- Shows the status UI
local status_id = 9
DCEI.ShowUnitStatusUi(status_id, unit_instance)
-- Hides the status UI after 2 seconds
local show_duration = 2
DCEI.TriggerAddTimerEventElapsed(function()
DCEI.HideUnitStatusUi(status_id, unit_instance)
end, show_duration)
void ShowUnitStatusUiForPlayer(int id, unit unit, int player)
void ShowUnitStatusUiForPlayer(int id, unit unit, int player)
Description
Shows the built-in status UI for the given unit for the given player.
Parameters
- int
id
the status UI to show. List of values.
2
- Large HP bar
3
- Slightly larger than default HP bar, bottom right corner "hero unit" UI
4
- Animated big hand pointer at the unit
5
- Top center HP bar with percent current HP
6
- Default speech bubble
7
- Nothing
8
- Yellow boxes/resource bar
9
- Yellow boxes as HP bar
10
- Nothing
11
- Top center HP bar with fractional current HP - unit
unit
the unit to show the status UI for. - int
player
the player to show the UI for.
Example Usage
-- Creates the unit
local team_id = 1
local player_id = 1
local unit_type = DCEI.Unit("Standard MeleeUnit")
local x, z = 16, 16
local unit_instance = DCEI.CreateUnit(team_id, player_id, unit_type, x, z)
-- Shows the status UI
local status_id = 9
DCEI.ShowUnitStatusUiForPlayer(status_id, unit_instance, player_id)
-- Hides the status UI after 2 seconds
local show_duration = 2
DCEI.TriggerAddTimerEventElapsed(function()
DCEI.HideUnitStatusUiForPlayer(status_id, unit_instance, player_id)
end, show_duration)
void SetUnitHealthBarUiScale(float scale)
void SetUnitHealthBarUiScale(float scale)
Description
Sets the scale of the unit health bar UI.
Parameters
- float
scale
the scale of the unit health bar. A value of0
will hide the health bar, useful when using ShowUnitStatusUi or custom frames.
Example Usage
local scale = 0.5
DCEI.SetUnitHealthBarUiScale(scale)
void SetGoldRewardTextScale(float scale)
void SetGoldRewardTextScale(float scale)
Description
Sets the scale of the gold reward text, displayed when units with a SetGoldBounty are killed.
Parameters
- float
scale
the scale of the gold reward text. A value of0
will hide the gold reward text.
Example Usage
local scale = 2
DCEI.SetGoldRewardTextScale(scale)
void ShowSpeechBubble(unit unit, int width, string content, string title)
void ShowSpeechBubble(unit unit, int width, string content, string title)
Description
Displays a speech bubble for the given unit. Speech bubble will disappear if the unit dies. Will not overwrite previous speech bubbles attached to the unit.
Parameters
- unit
unit
the unit to attach the speech bubble to. - int
width
theoretically, the width of the speech bubble. Appears to instead control the offset of the bubble containing the text from the arrow. - string
content
the content of the speech bubble. - string
title
the title of the speech bubble. Commonly used to show speaker name.
Example Usage
-- Creates the unit
local team_id = 1
local player_id = 1
local unit_type = DCEI.Unit("Standard MeleeUnit")
local x, z = 16, 16
local unit_instance = DCEI.CreateUnit(team_id, player_id, unit_type, x, z)
-- Creates the speech bubble
local width = 100
local content = "Content"
local title = "Title"
DCEI.ShowSpeechBubble(unit_instance, width, content, title)
void ShowSpeechBubble(unit unit, int width, string content, string title, TextOptions options)
void ShowSpeechBubble(unit unit, int width, string content, string title, TextOptions options)
Description
Displays a speech bubble for the given unit. Speech bubble will disappear if the unit dies. Will not overwrite previous speech bubbles attached to the unit.
Parameters
- unit
unit
the unit to attach the speech bubble to. - int
width
theoretically, the width of the speech bubble. Appears to instead control the offset of the bubble containing the text from the arrow. - string
content
the content of the speech bubble. - string
title
the title of the speech bubble. Commonly used to show speaker name. - TextOptions
options
the text options for the speech bubble. This controls the offset of the entire speech bubble.
Example Usage
-- Creates the unit
local team_id = 1
local player_id = 1
local unit_type = DCEI.Unit("Standard MeleeUnit")
local x, z = 16, 16
local unit_instance = DCEI.CreateUnit(team_id, player_id, unit_type, x, z)
-- Creates the speech bubble
local width = 100
local content = "Content"
local title = "Title"
local text_options = { offset = { right = 1, up = 1, front = 2 } }
DCEI.ShowSpeechBubble(unit_instance, width, content, title, text_options)
void ShowUnitLabel(unit unit, string content)
void ShowUnitLabel(unit unit, string content)
Description
Shows a text tag attached to a unit. Will not overwrite existing labels.
Parameters
- unit
unit
the unit show to a label for. - string
content
the text to display.
Example Usage
-- Creates the unit
local team_id = 1
local player_id = 1
local unit_type = DCEI.Unit("Standard MeleeUnit")
local x, z = 16, 16
local unit_instance = DCEI.CreateUnit(team_id, player_id, unit_type, x, z)
-- Creates the label
local content = "Content"
DCEI.ShowUnitLabel(unit_instance, content)
void ShowUnitLabel(unit unit, string content, UnitLabelOptions options)
void ShowUnitLabel(unit unit, string content, UnitLabelOptions options)
Description
Shows a text tag attached to a unit. Will not overwrite existing labels.
Parameters
- unit
unit
the unit show to a label for. - string
content
the text to display. - UnitLabelOptions
options
accepted values:
Example Usage
-- Creates the unit
local team_id = 1
local player_id = 1
local unit_type = DCEI.Unit("Standard MeleeUnit")
local x, z = 16, 16
local unit_instance = DCEI.CreateUnit(team_id, player_id, unit_type, x, z)
-- Creates the label
local content = "Content"
local label_options = {offset = {right = 1, up = 1, front = 1}, center_at_unit_origin = true, center_at_unit_top = true}
DCEI.ShowUnitLabel(unit_instance, content, label_options)
-- Hides the label after 2 seconds
local show_duration = 2
DCEI.TriggerAddTimerEventElapsed(function()
DCEI.HideUnitLabel(unit_instance)
end, show_duration)
void HideUnitLabel(unit unit)
void HideUnitLabel(unit unit)
Description
Hides a text tag attached to a unit.
Parameters
- unit
unit
the unit to hide the label on.
Example Usage
-- Creates the unit
local team_id = 1
local player_id = 1
local unit_type = DCEI.Unit("Standard MeleeUnit")
local x, z = 16, 16
local unit_instance = DCEI.CreateUnit(team_id, player_id, unit_type, x, z)
-- Creates the label
local content = "Content"
local label_options = {offset = {right = 1, up = 1, front = 1}, center_at_unit_origin = true, center_at_unit_top = true}
DCEI.ShowUnitLabel(unit_instance, content, label_options)
-- Hides the label after 2 seconds
local show_duration = 2
DCEI.TriggerAddTimerEventElapsed(function()
DCEI.HideUnitLabel(unit_instance)
end, show_duration)
void ShowFloatingText(float x, float y, float z, string content)
void ShowFloatingText(float x, float y, float z, string content)
Description
Displays floating text at the specified location. Text will immediately start to fade away.
Parameters
- float
x
the X coordinate. - float
y
the Y coordinate. - float
z
the Z coordinate. - string
content
the content of the floating text.
Example Usage
local x, y, z = 12, 4, 12
local text = "Floating Text"
DCEI.ShowFloatingText(x, y, z, text)
void ShowFloatingText(Float3 pos, string content, float stayDuration, int animationType, float animationDuration, TextOptions options)
void ShowFloatingText(Float3 pos, string content, float stayDuration, int animationType, float animationDuration, TextOptions options)
Description
Displays floating text at the specified location.
Parameters
- Float3
pos
the position for the floating text. - string
content
the content of the floating text. - float
stayDuration
the duration of the floating text. There is a short, fixed fade in and our duration at the start and end, respectively. If duration this is longer than theanimationDuration
, this duration will be used. - int
animationType
the animation of the floating text:0 - Text pops in
1 - text slowly floats upwards
- float
animationDuration
The duration of the animation. If this duration is longer than thestayDuration
, this duration will be used. - TextOptions
options
the text options for floating text.
Example Usage
local float_text_pos = { x = 15, y = 2, z = 15 }
local text = "Floating Text"
local duration = 5
local animation_type = 1
local animation_duration = 5
local text_options = { offset = { right = 1, up = 2, front = 2 } }
DCEI.ShowFloatingText(float_text_pos, text, duration, animation_type, animation_duration, text_options)
void ShowFloatingTextWithOptions(Float3 pos, string content, float stayDuration, int animationType, float animationDuration, TextOptions options)
void ShowFloatingTextWithOptions(Float3 pos, string content, float stayDuration, int animationType, float animationDuration, TextOptions options)
Description
Displays floating text at the specified location.
Parameters
- Float3
pos
the position for the floating text. - string
content
the content of the floating text. - float
stayDuration
the duration of the floating text. There is a short, fixed fade in and our duration at the start and end, respectively. If duration this is longer than theanimationDuration
, this duration will be used. - int
animationType
the animation of the floating text:0 - Text pops in
1 - text slowly floats upwards
- float
animationDuration
The duration of the animation. If this duration is longer than thestayDuration
, this duration will be used. - TextOptions
options
the text options for floating text.
Example Usage
local float_text_pos = { x = 15, y = 2, z = 15 }
local text = "Floating Text"
local duration = 5
local animation_type = 1
local animation_duration = 5
local text_options = { offset = { right = 1, up = 2, front = 2 } }
DCEI.ShowFloatingTextWithOptions(float_text_pos, text, duration, animation_type, animation_duration, text_options)
void ShowFloatingTextAtUnit(unit unit, string content, float stayDuration, int animationType, float animationDuration, UnitLabelOptions options)
void ShowFloatingTextAtUnit(unit unit, string content, float stayDuration, int animationType, float animationDuration, UnitLabelOptions options)
Description
Displays floating text at the specified unit.
Parameters
- unit
unit
the unit to create the floating text at. - string
content
the content of the floating text. - float
stayDuration
the duration of the floating text. There is a short, fixed fade in and our duration at the start and end, respectively. If duration this is longer than theanimationDuration
, this duration will be used. - int
animationType
the animation of the floating text:0 - Text pops in
1 - text slowly floats upwards
- float
animationDuration
The duration of the animation. If this duration is longer than thestayDuration
, this duration will be used. - UnitLabelOptions
options
accepted values:
Example Usage
local text = "Floating Text"
local duration = 5
local animation_type = 1
local animation_duration = 5
local label_options =
{ offset = { right = 1, up = 1, front = 1 }, center_at_unit_origin = true, center_at_unit_top = true }
DCEI.ShowFloatingTextAtUnit(unit, text, duration, animation_type, animation_duration, label_options)
void HideSpeechBubble(unit unit)
void HideSpeechBubble(unit unit)
Description
Hides a speech bubble attached to the given unit.
Parameters
- unit
unit
the unit to hide the speech bubble for.
Example Usage
-- Creates the unit
local team_id = 1
local player_id = 1
local unit_type = DCEI.Unit("Standard MeleeUnit")
local x, z = 16, 16
local unit_instance = DCEI.CreateUnit(team_id, player_id, unit_type, x, z)
-- Creates the speech bubble
local width = 100
local content = "Content"
local title = "Title"
DCEI.ShowSpeechBubble(unit_instance, width, content, title)
-- Hides the speech bubble after 2 seconds
local show_duration = 2
DCEI.TriggerAddTimerEventElapsed(function()
DCEI.HideSpeechBubble(unit_instance)
end, show_duration)
void ShowUnitStatusUiInSlot(int id, unit unit, int slotKey)
void ShowUnitStatusUiInSlot(int id, unit unit, int slotKey)
Description
Shows the built-in status UI for the given unit in the specified slot.
Parameters
int
id
the status UI to show. List of values.
2
- Large HP bar
3
- Slightly larger than default HP bar, bottom right corner "hero unit" UI
4
- Animated big hand pointer at the unit
5
- Top center HP bar with percent current HP
6
- Default speech bubble
7
- Nothing
8
- Yellow boxes/resource bar
9
- Yellow boxes as HP bar
10
- Nothing
11
- Top center HP bar with fractional current HPunit
unit
the unit to show the status UI for.int
slotKey
the slot key to bind the status UI to.
Example Usage
-- Creates the unit
local team_id = 1
local player_id = 1
local unit_type = DCEI.Unit("Standard MeleeUnit")
local x, z = 16, 16
local unit_instance = DCEI.CreateUnit(team_id, player_id, unit_type, x, z)
-- Shows the status UI
local status_id = 9
local slot_key = 1
DCEI.ShowUnitStatusUiInSlot(status_id, unit, slot_key)
void HideUnitStatusUi(int id, unit unit)
void HideUnitStatusUi(int id, unit unit)
Description
Hides the given built-in status UI for a given unit.
Parameters
- int
id
the status UI to hide.
2
- Large HP bar
3
- Slightly larger than default HP bar, bottom right corner "hero unit" UI
4
- Animated big hand pointer at the unit
5
- Top center HP bar with percent current HP
6
- Default speech bubble
7
- Nothing
8
- Yellow boxes/resource bar
9
- Yellow boxes as HP bar
10
- Nothing
11
- Top center HP bar with fractional current HP - unit
unit
the unit to hide the status UI for.
Example Usage
-- Creates the unit
local team_id = 1
local player_id = 1
local unit_type = DCEI.Unit("Standard MeleeUnit")
local x, z = 16, 16
local unit_instance = DCEI.CreateUnit(team_id, player_id, unit_type, x, z)
-- Shows the status UI
local status_id = 9
DCEI.ShowUnitStatusUi(status_id, unit_instance)
-- Hides the status UI after 2 seconds
local show_duration = 2
DCEI.TriggerAddTimerEventElapsed(function()
DCEI.HideUnitStatusUi(status_id, unit_instance)
end, show_duration)
void HideUnitStatusUiForPlayer(int id, unit unit, int player)
void HideUnitStatusUiForPlayer(int id, unit unit, int player)
Description
Hides the given built-in status UI for a given unit, for the given player.
Parameters
- int
id
the status UI to hide.
2
- Large HP bar
3
- Slightly larger than default HP bar, bottom right corner "hero unit" UI
4
- Animated big hand pointer at the unit
5
- Top center HP bar with percent current HP
6
- Default speech bubble
7
- Nothing
8
- Yellow boxes/resource bar
9
- Yellow boxes as HP bar
10
- Nothing
11
- Top center HP bar with fractional current HP - unit
unit
the unit to hide the status UI for. - int
player
the player to hide the status UI for.
Example Usage
-- Creates the unit
local team_id = 1
local player_id = 1
local unit_type = DCEI.Unit("Standard MeleeUnit")
local x, z = 16, 16
local unit_instance = DCEI.CreateUnit(team_id, player_id, unit_type, x, z)
-- Shows the status UI
local status_id = 9
DCEI.ShowUnitStatusUiForPlayer(status_id, unit_instance, player_id)
-- Hides the status UI after 2 seconds
local show_duration = 2
DCEI.TriggerAddTimerEventElapsed(function()
DCEI.HideUnitStatusUiForPlayer(status_id, unit_instance, player_id)
end, show_duration)
void ShowMessageWithButtonText(string title, string content, string button, string image1, string image2, string image3)
void ShowMessageWithButtonText(string title, string content, string button, string image1, string image2, string image3)
Description
Displays a pop-up message with a button. Displays up to 3 images.
Parameters
- string
title
the title of the message pop-up. - string
content
the text of the message. - string
button
the text on the button. - string
image1
the name or link to the first image. - string
image2
the name or link to the second image. - string
image3
the name or link to the third image.
Example Usage
local title = "Title"
local content = "Content"
local button_text = "Button Text"
local image1 = "airship_onMap"
local image2 = "crown_gold"
local image3 = "icon_boss"
DCEI.ShowMessageWithButtonText(title, content, button_text, image1, image2, image3)
void ShowBigHeadMessage(string title, string message, string image)
void ShowBigHeadMessage(string title, string message, string image)
Description
Displays a "big head" message. You can view a list of accepted images here.
May require an older editor build.
Parameters
- string
title
the title of the big head message. - string
message
the text of the big head message. - string
image
the big head image. Note that specific big head images must be used.
Example Usage
local title = "Title"
local message = "Message"
local image = "bighead_hero_smith"
DCEI.ShowBigHeadMessage(title, message, image)
void ShowBigHeadMessage(string title, string message, string image, BigHeadMessageOptions options)
void ShowBigHeadMessage(string title, string message, string image, BigHeadMessageOptions options)
Description
Displays a "big head" message with additional options. Will not overwrite an existing big head message. You can view a list of accepted images here.
May require an older editor build.
Parameters
- string
title
the title of the big head message. - string
message
the text of the big head message. - string
image
the big head image. Note that specific big head images must be used. - BigHeadMessageOptions
options
the additional options for a big head message.
Example Usage
local title = "Title"
local message = "Message"
local image = "bighead_hero_smith"
local big_head_options = {
pause = true,
on_dismiss = function()
DCEI.LogMessage("Dismissed")
end,
delay = 5,
message_box_color = { r = 255, g = 0, b = 255, a = 255 },
title_box_color = { r = 255, g = 0, b = 255, a = 255 },
}
DCEI.ShowBigHeadMessage(title, message, image, big_head_options)
void HideBigHeadMessage()
void HideBigHeadMessage()
Description
Example Usage
-- Creates the big head message
local title = "Title"
local message = "Message"
local image = "bighead_hero_smith"
local big_head_options = {
pause = true,
on_dismiss = function()
DCEI.LogMessage("Dismissed")
end,
delay = 5,
message_box_color = { r = 255, g = 0, b = 255, a = 255 },
title_box_color = { r = 255, g = 0, b = 255, a = 255 },
}
DCEI.ShowBigHeadMessage(title, message, image, big_head_options)
-- Hides the message after 2 seconds
local show_duration = 2
DCEI.TriggerAddTimerEventElapsed(function()
DCEI.HideBigHeadMessage()
end, show_duration)
void ShowScreenMask(float alpha = 0, ScreenBackgroundOptions options = default)
void ShowScreenMask(float alpha = 0, ScreenBackgroundOptions options = default)
Description
Shows a screen mask (overlay tint). This will block interaction with everything. This will also overwrite previous screen masks.
Parameters
- float
alpha
the alpha of the screen mask. - ScreenBackgroundOptions
options
lua dictionary{color, duration}
Example Usage
-- Creates the screen mask
local mask_alpha = 0.5
local screen_options = { color = { r = 255, g = 0, b = 255, a = 255 }, duration = 1 }
DCEI.ShowScreenMask(mask_alpha, screen_options)
-- Hides the mask after 2 seconds
local show_duration = 2
DCEI.TriggerAddTimerEventElapsed(function()
DCEI.HideScreenMask()
end, show_duration)
void HideScreenMask()
void HideScreenMask()
Description
Example Usage
-- Creates the screen mask
local mask_alpha = 0.5
local screen_options = { color = { r = 255, g = 0, b = 255, a = 255 }, duration = 1 }
DCEI.ShowScreenMask(mask_alpha, screen_options)
-- Hides the mask after 2 seconds
local show_duration = 2
DCEI.TriggerAddTimerEventElapsed(function()
DCEI.HideScreenMask()
end, show_duration)
void TakeScreenShot(string fileName, float delay = 0, int quality = 1)
void TakeScreenShot(string fileName, float delay = 0, int quality = 1)
Description
Takes a screenshot of the game. On Windows PCs, this file is saved in C:\Users\#YOUR_USER_NAME\AppData\Local\Temp\Wild Sky Dev\Wild Arcade
Parameters
- string
fileName
the name of the screenshot file - float
delay
delay before taking screenshot - int
quality
accepts integers 1 or higher. Higher values multiply the number of pixels in the image.
Example Usage
DCEI.TakeScreenShot("A-ScreenshotNormal", 0, 1)
DCEI.TakeScreenShot("A-ScreenshotHQ", 0.1, 6)
int TakeScreenShotWildSky(float delay = 0)
int TakeScreenShotWildSky(float delay = 0)
Description
Takes a screenshot of the game. Returns ID of screenshot taken.
Parameters
- float
delay
delay before taking screenshot
Example Usage
-- See also `DCEI.TakeScreenShot`
local screen_shot_index = DCEI.TakeScreenShotWildSky(1)
DCEI.Wait(1.125)
DCEI.DeleteScreenShot(screen_shot_index)
bool DeleteScreenShot(int key)
bool DeleteScreenShot(int key)
Description
Delete a screenshot from TakeScreenShotWildSky
Parameters
- int
key
id of screenshot to delete, fromTakeScreenShotWildSky
Example Usage
-- See also `DCEI.TakeScreenShot`
local screen_shot_index = DCEI.TakeScreenShotWildSky(1)
DCEI.Wait(1.125)
DCEI.DeleteScreenShot(screen_shot_index)
void ShowSlowMotionEffect()
void ShowSlowMotionEffect()
Description
Shows the slow motion effect on the screen.
Example Usage
-- Starts the slow motion effect
DCEI.ShowSlowMotionEffect()
-- Hides the effect after 2 seconds
local show_duration = 2
DCEI.TriggerAddTimerEventElapsed(function()
DCEI.HideSlowMotionEffect()
end, show_duration)
void HideSlowMotionEffect()
void HideSlowMotionEffect()
Description
Hides the slow motion effect on the screen.
Example Usage
-- Starts the slow motion effect
DCEI.ShowSlowMotionEffect()
-- Hides the effect after 2 seconds
local show_duration = 2
DCEI.TriggerAddTimerEventElapsed(function()
DCEI.HideSlowMotionEffect()
end, show_duration)