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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


Hides any big head messages.

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

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


Hides any active screen mask.

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

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

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

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)