Built In UI Functions Overview - funovus/editor-wiki GitHub Wiki
This page covers the editor's currently available built-in UI functions. These are hardcoded functions you may find useful for quick prototyping. For more advanced UI, you'll want to build your own.
Download the example map here.
- Big Head Message
- Circle Menu
- Fast Forward Button
- Feedback Message
- Floating Text
- Help Button
- Hero Status
- Left Menu
- Message Box
- Objective Display
- Screen Mask
- Slow Motion FX
- Speech Bubble
- Unit Label
Displays a "big head" image with a title and text.
local bighead_images = {
"bighead_hero_smith",
"bighead_hero_windknight",
"bighead_hero_icemage_02",
"bighead_hero_chosengirl",
"bighead_hero_alchemist",
"bighead_hero_lastdragoon"
}
local title = "Hero"
local text = "This is a \"Big Head\" Message!"
local image = bighead_images[math.random(1, #bighead_images)]
DCEI.ShowBigHeadMessage(title, text, image)
DCEI.HideBigHeadMessage()
Displays a circular command card for a unit that displays up to six abilities.
-- 0 is the command card index
DCEI.ShowAbilitiesUi(0, unit)
DCEI.HideAbilitiesUi(0, unit)
Hide the fast forward button.
DCEI.HideFastForwardButton()
Displays a feedback message in the middle of the screen.
local text = "This is a feedback message."
DCEI.ShowFeedbackMessage(text)
Create floating text at a unit.
-- use anim_id = 0 for bounce-in animation
-- use anim_id = 1 for float-up animation
local pos = DCEI.GetUnitPosition3D(unit)
local text = "<color=green>" .. "text!"
local anim_id = 0
local show_duration = 0.5
local anim_duration = 1
--optional offset options
local options = {
offset = {
up = 1.25,
right = 0,
front = 0
}
}
DCEI.ShowFloatingText(
pos,
text,
show_duration,
anim_id,
anim_duration,
options
)
Shows a help button that runs a function when clicked, commonly combined with a message box to give gameplay tips.
function ShowQuestionMessage()
local title = "Another Message"
local body = "The question button runs a function when pressed, such as showing a message box."
local button_text = "Continue"
DCEI.ShowMessageWithButtonText(title, body, button_text)
end
DCEI.SetQuestionButton(ShowQuestionMessage)
Shows a portrait, health bar, mana bar, and ability cast button for a unit.
DCEI.ShowUnitStatusUiInSlot(3, hero, slot) -- shows unit status
DCEI.ShowAbilitiesUiInSlot(2, hero, slot) -- shows ability button
DCEI.HideUnitStatusUi(3, unit) -- hides unit status (this doesn't seem to work)
DCEI.HideAbilitiesUi(2, unit) -- hides ability button
Shows a mana bar and ability buttons for a unit.
DCEI.ShowShipSpellMenu()
DCEI.ShowUnitStatusUi(2, unit) -- shows mana bar
DCEI.ShowAbilitiesUi(1, unit) -- shows abilities
DCEI.HideShipSpellMenu()
DCEI.HideUnitStatusUi(2, unit) -- hides mana bar
DCEI.HideAbilitiesUi(1, unit) -- hides abilities
Displays a modal message box that pauses gameplay and masks user input until dismissed.
local title = "Message Title"
local body = (
"This is a message box. It pauses the game.\n" ..
"It supports multiple lines.\n" ..
"And also <color=yellow>rich text</color><size=125%>!</size></color><size=175%>!</size></color><size=125%>!</size>\n" ..
"It also supports images, but you can't use custom images yet so this is of limited use."
)
local button_text = "Continue"
DCEI.ShowMessageWithButtonText(title, body, button_text)
Shows objective text in the upper left corner of the screen.
DCEI.ShowObjective("- Objective Text")
DCEI.HideObjective()
Shows a screen mask with or without alpha that completely blocks mouse input while shown.
local alpha_value = 0.5
DCEI.ShowScreenMaskWithAlpha(alpha_value)
DCEI.ShowScreenMask() -- functionally the same as as DCEI.ShowScreenMaskWithAlpha(0)
DCEI.HideScreenMask()
Overlays a vignette and some particle FX.
DCEI.ShowSlowMotionEffect()
DCEI.HideSlowMotionEffect()
Attach a speech bubble with a title to a unit.
local max_width = 320
local text = "Hello!"
local title = "Slime"
-- optional offset options
local options = {
up = 0.5,
right = 0,
front = 0
}
DCEI.ShowSpeechBubble(unit, max_width, text, title, options)
DCEI.HideSpeechBubble(unit)
Attach static text to a unit. Supports rich text.
local text = "Some Text"
-- optional offset options
local options = {
offset = {
right = 0,
up = 0.5,
front = 0
}
}
-- shows unit label
DCEI.ShowUnitLabel(unit, text, options)
-- hides unit label
DCEI.HideUnitLabel(unit)