Trigger API Reference\DCEI Functions\Custom UI

void SetSelectedUi(InGameUILayoutComponent ui)

void SetSelectedUi(InGameUILayoutComponent ui)

Description


Selects a custom UI frame. In practical terms, this isn't the same as an input event, such as clicking a button, but rather like focusing on the UI frame. For a text input frame, this would allow the user to immediately begin typing input.

Parameters

Example Usage

local input_text = DCEI.CreateUserInputTextFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(input_text, 200, 50)
DCEI.SetUserInputTextFrameText(input_text, "pretend I'm user input text")
-- Select the newly created user input text frame
DCEI.SetSelectedUi(input_text)

void WaitForUiUpdateToComplete(TypedCallback callback)

void WaitForUiUpdateToComplete(TypedCallback callback)

Description


Runs the callback after engine finishes updating UI layout but before the updated layout is shown on the screen.

Parameters

Example Usage

local button = DCEI.CreateButtonFrame(GMUI.ui.Root)
DCEI.SetFrameSize(button, 100, 100)
DCEI.WaitForUiUpdateToComplete(function()
    DCEI.LogMessage("We can get (and set) button position after it initializes but before it renders on screen")
    local pos = DCEI.GetFrameCanvasPosition3D(button)
    DCEI.MoveFrameToCanvasPosition(button, pos, { right = 100 })
end)

InGameUILayoutComponent GetUiRootFrame()

InGameUILayoutComponent GetUiRootFrame()

Description


Returns the root UI frame.

Example Usage

local button_layout = GMUI.Layout.New({
    parent = DCEI.GetUiRootFrame(),
    name = "Standard/Button/Button",
})

DCEI.SetTextFrameText(button_layout.Label, "Button Example")

Float2 GetUiCanvasSize(bool ignoreSafeArea = False)

Float2 GetUiCanvasSize(bool ignoreSafeArea = False)

Description


Returns the UI canvas size.

Parameters

Example Usage

local ui_canvas_size = DCEI.GetUiCanvasSize(true)
DCEI.LogMessage("UI canvas X dim: " .. ui_canvas_size.x .. " Y dim: " .. ui_canvas_size.y)

float SetUiSizeMultiplier(float multiplier)

float SetUiSizeMultiplier(float multiplier)

Description


Applies a multiplier to all size parameters of all custom UI frames. This was added to help migrate legacy maps to portrait mode, due to the canvas scaling change.

Parameters

Example Usage

local multiplier = 16/9
DCEI.SetUiSizeMultiplier(multiplier)

InGameUILayoutComponent GetUiRootFrameForPlayer(int player)

InGameUILayoutComponent GetUiRootFrameForPlayer(int player)

Description


Returns the root UI frame for the given player.

Parameters

Example Usage

local button_layout = GMUI.Layout.New({
    parent = DCEI.GetUiRootFrameForPlayer(1),
    name = "Standard/Button/Button",
})

DCEI.SetTextFrameText(button_layout.Label, "Button Example")

void DestroyFrame(InGameUILayoutComponent ui)

void DestroyFrame(InGameUILayoutComponent ui)

Description


Destroys the given UI frame and all its children.

Parameters

Example Usage

local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.DestroyFrame(frame)

bool FrameExists(InGameUILayoutComponent ui)

bool FrameExists(InGameUILayoutComponent ui)

Description


Returns true if the given UI exists.

Parameters

Example Usage

local ui_exists = DCEI.FrameExists(DCEI.GetUiRootFrame())
DCEI.LogMessage("Root UI exists: " .. tostring(ui_exists))

InGameUILayoutComponent GetParentFrame(InGameUILayoutComponent item)

InGameUILayoutComponent GetParentFrame(InGameUILayoutComponent item)

Description


Returns the parent frame of the given UI frame.

Parameters

Example Usage

local parent_frame = DCEI.GetParentFrame(frame)
DCEI.CreateFrame(parent_frame)

InGameUILayoutComponent CreateFrame(InGameUILayoutComponent parent)

InGameUILayoutComponent CreateFrame(InGameUILayoutComponent parent)

Description


Creates and returns a new frame as a child of the given a parent frame. This frame has a default height/width of 0 and expands to fit any children.

Parameters

Example Usage

-- creates a red square
local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(frame, 200, 200)
DCEI.SetFrameImageColor(frame, {r = 1, g = 0, b = 0, a = 1})

float GetFrameWidth(InGameUILayoutComponent ui)

float GetFrameWidth(InGameUILayoutComponent ui)

Description


Returns the width of a UI frame. Note that UI frame size changes are applied at the end of a game update, so you'd need to wait a frame after changing the size of a UI frame to get the new dimensions.

Parameters

Example Usage

local root_width = DCEI.GetFrameWidth(DCEI.GetUiRootFrame())
DCEI.LogMessage("The width of the root UI frame is: " .. root_width)

float GetFrameHeight(InGameUILayoutComponent ui)

float GetFrameHeight(InGameUILayoutComponent ui)

Description


Returns the height of a UI frame. Note that UI frame size changes are applied at the end of a game update, so you'd need to wait a frame after changing the size of a UI frame to get the new dimensions.

Parameters

Example Usage

local root_height = DCEI.GetFrameHeight(DCEI.GetUiRootFrame())
DCEI.LogMessage("The height of the root UI frame is: " .. root_height)

void SetFrameUseImageSizeRatio(InGameUILayoutComponent ui, float ratio)

void SetFrameUseImageSizeRatio(InGameUILayoutComponent ui, float ratio)

Description


Makes the given UI frame set its sized based on the texture used for it's background image. This ratio determines the rendering size of the frame, where 1 will use the original dimensions of the texture. Once set, setting either height or width (but not both) will adjust the other dimension proportionally to match the size ratio.

Parameters

Example Usage

local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameImage(frame, DCEI.Texture("airship_onMap"))
DCEI.SetFrameUseImageSizeRatio(frame, 2)

void SetFrameAlpha(InGameUILayoutComponent ui, float alpha)

void SetFrameAlpha(InGameUILayoutComponent ui, float alpha)

Description


Sets the transparency for the given UI frame and all of its children. This option with have a compounding effect with an alpha value set by SetFrameImageColor. Child frames cannot be made less transparent than their parent with this function.

Parameters

Example Usage

local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(frame, 200, 200)
DCEI.SetFrameImageColor(frame, {r = 1, g = 0, b = 0, a = 1})
DCEI.SetFrameAlpha(frame, 0.5)

InGameUILayoutComponent CreateMaskFrame(InGameUILayoutComponent parent)

InGameUILayoutComponent CreateMaskFrame(InGameUILayoutComponent parent)

Description


Creates a mask. Masks can be used to 'crop' child frames to the masks size/shape. If given a background image, the opaque white pixels will be used to determine the shape of the effect. By default, this frame type attempts to fill its parent size unless given explicit dimensions.

Parameters

Example Usage

-- mask's its children using a circle texture
local mask = DCEI.CreateMaskFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameImage(mask, DCEI.Texture("circle_mask"))
DCEI.SetFrameSize(mask, 150, 150)

-- frame to mask (note the original texture is square)
local frame = DCEI.CreateFrame(mask)
DCEI.SetFrameImage(frame, DCEI.Texture("question_green"))
DCEI.SetFrameSize(frame, 200, 200)

InGameUILayoutComponent CreateStencilMaskFrame(InGameUILayoutComponent parent)

InGameUILayoutComponent CreateStencilMaskFrame(InGameUILayoutComponent parent)

Description


Creates a stencil mask. Stencil masks can be used to 'cut holes' in a parent mask frame. Similar to a mask frame, if given a background image, the white/opaque values will be used to determine the shape of the effect. A stencil mask will also cut through any of its sibling frames. By default, this frame type attempts to fill its parent size unless given explicit dimensions.

Parameters

Example Usage

-- fullscreen mask that can be used by the stencil
local mask = DCEI.CreateMaskFrame(DCEI.GetUiRootFrame())

-- stencil used to cut out a section from the mask and its children
local stencil = DCEI.CreateStencilMaskFrame(mask)
DCEI.SetFrameSize(stencil, 100, 100)
DCEI.SetFrameImage(stencil, DCEI.Texture("circle_mask"))

-- this frame will be affected by the stencil
local frame_to_stencil = DCEI.CreateFrame(mask)
DCEI.SetFrameMatchParent(frame_to_stencil, true, true)
DCEI.SetFrameImageColor(frame_to_stencil, 0, 0, 0, 0.5)

InGameUILayoutComponent CreateHighlightFrame(InGameUILayoutComponent parent)

InGameUILayoutComponent CreateHighlightFrame(InGameUILayoutComponent parent)

Description


Creates a highlight frame. If the highlight is given a background image, it will animate a highlight effect across the texture; otherwise the highlight will display a simple animation around its border. This frame type has a default size of 0 and expands to fit any children.

Parameters

Example Usage

local highlight = DCEI.CreateHighlightFrame(DCEI.GetUiRootFrame())
local frame = DCEI.CreateFrame(highlight)
DCEI.SetFrameSize(frame, 100, 100)

InGameUILayoutComponent CreateCameraFrame(InGameUILayoutComponent parent)

InGameUILayoutComponent CreateCameraFrame(InGameUILayoutComponent parent)

Description


Creates a new camera frame. Camera frames can be used to project views of the game world onto a UI frame. This can be used to make animated portraits using in-game models, among other uses. Requires the use of helper functions to set default values.

Parameters

Example Usage

-- create unit
DCEI.CreateUnit(1, 1, DCEI.Unit("Standard MeleeUnit"), 16, 12, 0, -1)

-- create camera frame border
local container = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameImage(container, DCEI.Texture("frame01"))
DCEI.SetFramePadding(container, 10)

-- create camera frame facing our unit
local camera = DCEI.CreateCameraFrame(container)
DCEI.SetFrameSize(camera, 150, 150)
DCEI.SetCameraFrameViewportSize(camera, 200, 200)
DCEI.SetCameraFrameViewportWorldPosition(camera, 16, 1, 11)
DCEI.SetCameraFrameViewportRotation(camera, 35, 0, 0)

InGameUILayoutComponent CreateVStackFrame(InGameUILayoutComponent parent)

InGameUILayoutComponent CreateVStackFrame(InGameUILayoutComponent parent)

Description


Creates a new vertical stack. This frame will arrange child frames vertically within it. By default, child frames are stacked from top to bottom. This frame type has a default size of 0 and expands to fit any children.

Parameters

Example Usage

local stack = DCEI.CreateVStackFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(stack, 200, 600)
DCEI.SetFrameImageColor(stack, {r = 0, g = 0, b = 1, a = 0.2})

local frame1 = DCEI.CreateFrame(stack)
DCEI.SetFrameSize(frame1, 200, 100)
DCEI.SetFrameImageColor(frame1, {r = 1, g = 1, b = 0, a = 0.5})

local frame2 = DCEI.CreateFrame(stack)
DCEI.SetFrameSize(frame2, 200, 100)
DCEI.SetFrameImageColor(frame2, {r = 1, g = 0, b = 1, a = 0.4})

local frame3 = DCEI.CreateFrame(stack)
DCEI.SetFrameSize(frame3, 200, 100)
DCEI.SetFrameImageColor(frame3, {r = 1, g = 0, b = 0, a = 0.6})

local frame4 = DCEI.CreateFrame(stack)
DCEI.SetFrameSize(frame4, 200, 100)
DCEI.SetFrameImageColor(frame4, {r = 1, g = 1, b = 1, a = 0.3})

local frame5 = DCEI.CreateFrame(stack)
DCEI.SetFrameSize(frame5, 200, 100)
DCEI.SetFrameImageColor(frame5, {r = 1, g = 1, b = 0, a = 1})

InGameUILayoutComponent CreateHStackFrame(InGameUILayoutComponent parent)

InGameUILayoutComponent CreateHStackFrame(InGameUILayoutComponent parent)

Description


Creates a new horizontal stack. This frame will arrange child frames horizontally within it. By default, child frames are stacked from left to right. This frame type has a default size of 0 and expands to fit any children. If this frame is assigned a set size, oversized child frames will overflow.

Parameters

Example Usage

local stack = DCEI.CreateHStackFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameImageColor(stack, {r = 0, g = 0, b = 1, a = 0.2})
DCEI.SetFrameSize(stack, 600, 100)

local frame1 = DCEI.CreateFrame(stack)
DCEI.SetFrameSize(frame1, 100, 100)
DCEI.SetFrameImageColor(frame1, {r = 1, g = 1, b = 0, a = 0.5})

local frame2 = DCEI.CreateFrame(stack)
DCEI.SetFrameSize(frame2, 100, 100)
DCEI.SetFrameImageColor(frame2, {r = 1, g = 0, b = 1, a = 0.4})

local frame3 = DCEI.CreateFrame(stack)
DCEI.SetFrameSize(frame3, 100, 100)
DCEI.SetFrameImageColor(frame3, {r = 1, g = 0, b = 0, a = 0.6})

local frame4 = DCEI.CreateFrame(stack)
DCEI.SetFrameSize(frame4, 100, 100)
DCEI.SetFrameImageColor(frame4, {r = 1, g = 1, b = 1, a = 0.3})

local frame5 = DCEI.CreateFrame(stack)
DCEI.SetFrameSize(frame5, 100, 100)
DCEI.SetFrameImageColor(frame5, {r = 1, g = 1, b = 0, a = 1})

InGameUILayoutComponent CreateGridFrame(InGameUILayoutComponent parent)

InGameUILayoutComponent CreateGridFrame(InGameUILayoutComponent parent)

Description


Creates a new grid. This frame will arrange child frames in a grid by determining the number of rows/columns automatically from the cellWidth and cellHeight properties. This should be followed by SetGridFrameCellHeight and SetGridFrameCellWidth to set the aforementioned properties, as it does not have default values for either.

Parameters

Example Usage

local grid = DCEI.CreateGridFrame(DCEI.GetUiRootFrame())
DCEI.SetGridFrameCellHeight(grid, 100)
DCEI.SetGridFrameCellWidth(grid, 100)
DCEI.SetFrameSize(grid, 200, 200)

local content1 = DCEI.CreateTextFrame(grid)
DCEI.SetTextFrameText(content1, "a")
DCEI.SetFrameSize(content1, 100, 100)
local content2 = DCEI.CreateTextFrame(grid)
DCEI.SetTextFrameText(content2, "b")
DCEI.SetFrameSize(content2, 100, 100)
local content3 = DCEI.CreateTextFrame(grid)
DCEI.SetTextFrameText(content3, "c")
DCEI.SetFrameSize(content3, 100, 100)
local content4 = DCEI.CreateTextFrame(grid)
DCEI.SetTextFrameText(content4, "d")
DCEI.SetFrameSize(content4, 100, 100)

void SetGridFrameLeftAlignment(InGameUILayoutComponent ui)

void SetGridFrameLeftAlignment(InGameUILayoutComponent ui)

Description


Sets left alignment for a UI frame's contents.

Parameters

Example Usage

local frame1 = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(frame1, 200, 200)
DCEI.SetFrameImageColor(frame1, {r = 1, g = 0, b = 1, a = 0.4})
DCEI.SetGridFrameLeftAlignment(frame1)

local frame2 = DCEI.CreateFrame(frame1)
DCEI.SetFrameSize(frame2, 100, 100)
DCEI.SetFrameImageColor(frame2, {r = 0, g = 1, b = 1, a = 0.4})

void SetGridFrameRightAlignment(InGameUILayoutComponent ui)

void SetGridFrameRightAlignment(InGameUILayoutComponent ui)

Description


Sets right alignment for a UI frame's contents.

Parameters

Example Usage

local frame1 = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(frame1, 200, 200)
DCEI.SetFrameImageColor(frame1, {r = 1, g = 0, b = 1, a = 0.4})
DCEI.SetGridFrameRightAlignment(frame1)

local frame2 = DCEI.CreateFrame(frame1)
DCEI.SetFrameSize(frame2, 100, 100)
DCEI.SetFrameImageColor(frame2, {r = 0, g = 1, b = 1, a = 0.4})

void SetGridFrameHorizontalCenterAlignment(InGameUILayoutComponent ui)

void SetGridFrameHorizontalCenterAlignment(InGameUILayoutComponent ui)

Description


Sets horizontal center alignment for a UI frame's contents.

Parameters

Example Usage

local frame1 = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(frame1, 200, 200)
DCEI.SetFrameImageColor(frame1, {r = 1, g = 0, b = 1, a = 0.4})
DCEI.SetGridFrameHorizontalCenterAlignment(frame1)

local frame2 = DCEI.CreateFrame(frame1)
DCEI.SetFrameSize(frame2, 100, 100)
DCEI.SetFrameImageColor(frame2, {r = 0, g = 1, b = 1, a = 0.4})

void SetGridFrameTopAlignment(InGameUILayoutComponent ui)

void SetGridFrameTopAlignment(InGameUILayoutComponent ui)

Description


Sets top alignment for a UI frame's contents.

Parameters

Example Usage

local frame1 = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(frame1, 200, 200)
DCEI.SetFrameImageColor(frame1, {r = 1, g = 0, b = 1, a = 0.4})
DCEI.SetGridFrameTopAlignment(frame1)

local frame2 = DCEI.CreateFrame(frame1)
DCEI.SetFrameSize(frame2, 100, 100)
DCEI.SetFrameImageColor(frame2, {r = 0, g = 1, b = 1, a = 0.4})

void SetGridFrameBottomAlignment(InGameUILayoutComponent ui)

void SetGridFrameBottomAlignment(InGameUILayoutComponent ui)

Description


Sets bottom alignment for a UI frame's contents.

Parameters

Example Usage

local frame1 = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(frame1, 200, 200)
DCEI.SetFrameImageColor(frame1, {r = 1, g = 0, b = 1, a = 0.4})
DCEI.SetGridFrameBottomAlignment(frame1)

local frame2 = DCEI.CreateFrame(frame1)
DCEI.SetFrameSize(frame2, 100, 100)
DCEI.SetFrameImageColor(frame2, {r = 0, g = 1, b = 1, a = 0.4})

void SetGridFrameVerticalCenterAlignment(InGameUILayoutComponent ui)

void SetGridFrameVerticalCenterAlignment(InGameUILayoutComponent ui)

Description


Sets vertical center alignment for a UI frame's contents.

Parameters

Example Usage

local frame1 = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(frame1, 200, 200)
DCEI.SetFrameImageColor(frame1, {r = 1, g = 0, b = 1, a = 0.4})
DCEI.SetGridFrameVerticalCenterAlignment(frame1)

local frame2 = DCEI.CreateFrame(frame1)
DCEI.SetFrameSize(frame2, 100, 100)
DCEI.SetFrameImageColor(frame2, {r = 0, g = 1, b = 1, a = 0.4})

InGameUILayoutComponent CreateHScrollFrame(InGameUILayoutComponent parent)

InGameUILayoutComponent CreateHScrollFrame(InGameUILayoutComponent parent)

Description


Creates a new horizontal scrolling frame. This frame functions similarly to a CreateHStackFrame, in that it will arrange its child frames horizontally, however this frame also supports horizontal scrolling if the contents would be larger than the size of the scroll frame. Do not place content inside this frame directly, instead use GetScrollFrameContent to fetch the content frame. By default, this frame type attempts to fill its parent size unless given explicit dimensions.

Parameters

Example Usage

local hscroll_frame = DCEI.CreateHScrollFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameImage(hscroll_frame, DCEI.Texture("frame01"))
DCEI.SetFrameSize(hscroll_frame, 350, 120)

local hscroll_content = DCEI.GetScrollFrameContent(hscroll_frame)
DCEI.SetFrameSpacing(hscroll_content, 10)
DCEI.SetFramePadding(hscroll_content, 10)

local frame1 = DCEI.CreateFrame(hscroll_content)
DCEI.SetFrameSize(frame1, 100, 100)
DCEI.SetFrameImage(frame1, DCEI.Texture("frame01_blue"))

local frame2 = DCEI.CreateFrame(hscroll_content)
DCEI.SetFrameSize(frame2, 100, 100)
DCEI.SetFrameImage(frame2, DCEI.Texture("frame01_brown"))

local frame3 = DCEI.CreateFrame(hscroll_content)
DCEI.SetFrameSize(frame3, 100, 100)
DCEI.SetFrameImage(frame3, DCEI.Texture("frame01_purple"))

local frame4 = DCEI.CreateFrame(hscroll_content)
DCEI.SetFrameSize(frame4, 100, 100)
DCEI.SetFrameImage(frame4, DCEI.Texture("frame01_grey"))

local frame5 = DCEI.CreateFrame(hscroll_content)
DCEI.SetFrameSize(frame5, 100, 100)
DCEI.SetFrameImage(frame5, DCEI.Texture("frame01_yellow"))

InGameUILayoutComponent CreateVScrollFrame(InGameUILayoutComponent parent)

InGameUILayoutComponent CreateVScrollFrame(InGameUILayoutComponent parent)

Description


Creates a new vertically scrolling frame. This frame functions similarly to a CreateVStackFrame, in that it will arrange its child frames vertically, however this frame also supports vertical scrolling if the contents would be larger than the size of the scroll frame. Do not place content inside this frame directly, instead use GetScrollFrameContent to fetch the content frame. By default, this frame type attempts to fill its parent size unless given explicit dimensions.

Parameters

Example Usage

local vscroll_frame = DCEI.CreateVScrollFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameImage(vscroll_frame, DCEI.Texture("frame01"))
DCEI.SetFrameSize(vscroll_frame, 120, 350)

local vscroll_content = DCEI.GetScrollFrameContent(vscroll_frame)
DCEI.SetFrameSpacing(vscroll_content, 10)
DCEI.SetFramePadding(vscroll_content, 10)

local frame1 = DCEI.CreateFrame(vscroll_content)
DCEI.SetFrameSize(frame1, 100, 100)
DCEI.SetFrameImage(frame1, DCEI.Texture("frame01_blue"))

local frame2 = DCEI.CreateFrame(vscroll_content)
DCEI.SetFrameSize(frame2, 100, 100)
DCEI.SetFrameImage(frame2, DCEI.Texture("frame01_brown"))

local frame3 = DCEI.CreateFrame(vscroll_content)
DCEI.SetFrameSize(frame3, 100, 100)
DCEI.SetFrameImage(frame3, DCEI.Texture("frame01_purple"))

local frame4 = DCEI.CreateFrame(vscroll_content)
DCEI.SetFrameSize(frame4, 100, 100)
DCEI.SetFrameImage(frame4, DCEI.Texture("frame01_grey"))

local frame5 = DCEI.CreateFrame(vscroll_content)
DCEI.SetFrameSize(frame5, 100, 100)
DCEI.SetFrameImage(frame5, DCEI.Texture("frame01_yellow"))

InGameUILayoutComponent CreateScrollFrame(InGameUILayoutComponent parent)

InGameUILayoutComponent CreateScrollFrame(InGameUILayoutComponent parent)

Description


Creates a horizontally and vertically scrolling frame. Useful for making scrollable maps. Do not place content inside this frame directly, instead use GetScrollFrameContent] to fetch the content frame. By default, this frame type attempts to fill its parent size unless given explicit dimensions.

Parameters

Example Usage

local scroll_frame = DCEI.CreateScrollFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(scroll_frame, 500, 500)
DCEI.SetFrameImageColor(scroll_frame, {r = 1, g = 0, b = 0, a = 0.3})
DCEI.SetScrollFrameScrollInertia(scroll_frame, false)
local scroll_content = DCEI.GetScrollFrameContent(scroll_frame)

local big_content = DCEI.CreateFrame(scroll_content)
DCEI.SetFrameSize(big_content, 1000, 1000)
DCEI.SetFrameImageColor(big_content, {r = 0, g = 0, b = 1, a = 0.4})

local small_content = DCEI.CreateFrame(scroll_content)
DCEI.SetFrameSize(small_content, 100, 100)
DCEI.SetFrameImageColor(small_content, {r = 0, g = 1, b = 0, a = 0.4})

int GetFrameIndexInParent(InGameUILayoutComponent item)

int GetFrameIndexInParent(InGameUILayoutComponent item)

Description


Returns the given UI frame's child index in its parent UI frame. This can be useful for getting an item's position from within a stack.

Parameters

Example Usage

local stack = DCEI.CreateHStackFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(stack, 100, 100)

local frame1 = DCEI.CreateFrame(stack)
DCEI.SetFrameSize(frame1, 100, 100)
DCEI.SetFrameImageColor(frame1, {r = 1, g = 0, b = 0, a = 0.4})

local frame2 = DCEI.CreateFrame(stack)
DCEI.SetFrameSize(frame2, 100, 100)
DCEI.SetFrameImageColor(frame2, {r = 1, g = 0, b = 0, a = 0.6})

local frame3 = DCEI.CreateFrame(stack)
DCEI.SetFrameSize(frame3, 100, 100)
DCEI.SetFrameImageColor(frame3, {r = 1, g = 0, b = 0, a = 0.8})

local frame4 = DCEI.CreateFrame(stack)
DCEI.SetFrameSize(frame4, 100, 100)
DCEI.SetFrameImageColor(frame4, {r = 0, g = 1, b = 0, a = 1})

local frame_index = DCEI.GetFrameIndexInParent(frame4)
DCEI.LogMessage("The child index of 'frame4' is: " .. frame_index)

void SetFrameIndexInParent(InGameUILayoutComponent item, int index)

void SetFrameIndexInParent(InGameUILayoutComponent item, int index)

Description


Sets the given UI frame's child index in its parent UI frame. If the new index already has a UI frame assigned to it, the frame will be inserted at the new position and its siblings indices will update to match the new order. Indices must be contiguous, trying to set a child's index to a non-contiguous index will just set it to the last contiguous index. The frame index is by default the order in which the child frames were created within the parent.

Parameters

Example Usage

local hscroll_frame = DCEI.CreateHScrollFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameImage(hscroll_frame, DCEI.Texture("frame01"))
DCEI.SetFrameSize(hscroll_frame, 350, 120)

local hscroll_content = DCEI.GetScrollFrameContent(hscroll_frame)
DCEI.SetFrameSpacing(hscroll_content, 10)
DCEI.SetFramePadding(hscroll_content, 10)

local frame1 = DCEI.CreateFrame(hscroll_content)
DCEI.SetFrameSize(frame1, 100, 100)
DCEI.SetFrameImage(frame1, DCEI.Texture("frame01_blue"))

local frame2 = DCEI.CreateFrame(hscroll_content)
DCEI.SetFrameSize(frame2, 100, 100)
DCEI.SetFrameImage(frame2, DCEI.Texture("frame01_brown"))

local frame3 = DCEI.CreateFrame(hscroll_content)
DCEI.SetFrameSize(frame3, 100, 100)
DCEI.SetFrameImage(frame3, DCEI.Texture("frame01_purple"))
-- This will move 'frame3' to the first index, causing it to display first
DCEI.SetFrameIndexInParent(frame3, 1)

local frame4 = DCEI.CreateFrame(hscroll_content)
DCEI.SetFrameSize(frame4, 100, 100)
DCEI.SetFrameImage(frame4, DCEI.Texture("frame01_grey"))

local frame5 = DCEI.CreateFrame(hscroll_content)
DCEI.SetFrameSize(frame5, 100, 100)
DCEI.SetFrameImage(frame5, DCEI.Texture("frame01_yellow"))

int GetChildrenFrameCount(InGameUILayoutComponent parent)

int GetChildrenFrameCount(InGameUILayoutComponent parent)

Description


Returns the number of child frames.

Parameters

Example Usage

local hscroll_frame = DCEI.CreateHScrollFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameImage(hscroll_frame, DCEI.Texture("frame01"))
DCEI.SetFrameSize(hscroll_frame, 350, 120)

local hscroll_content = DCEI.GetScrollFrameContent(hscroll_frame)
DCEI.SetFrameSpacing(hscroll_content, 10)
DCEI.SetFramePadding(hscroll_content, 10)

local frame1 = DCEI.CreateFrame(hscroll_content)
DCEI.SetFrameSize(frame1, 100, 100)
DCEI.SetFrameImage(frame1, DCEI.Texture("frame01_blue"))

local frame2 = DCEI.CreateFrame(hscroll_content)
DCEI.SetFrameSize(frame2, 100, 100)
DCEI.SetFrameImage(frame2, DCEI.Texture("frame01_brown"))

local frame3 = DCEI.CreateFrame(hscroll_content)
DCEI.SetFrameSize(frame3, 100, 100)
DCEI.SetFrameImage(frame3, DCEI.Texture("frame01_purple"))

local frame4 = DCEI.CreateFrame(hscroll_content)
DCEI.SetFrameSize(frame4, 100, 100)
DCEI.SetFrameImage(frame4, DCEI.Texture("frame01_grey"))

local frame5 = DCEI.CreateFrame(hscroll_content)
DCEI.SetFrameSize(frame5, 100, 100)
DCEI.SetFrameImage(frame5, DCEI.Texture("frame01_yellow"))

local child_frame_count = DCEI.GetChildrenFrameCount(hscroll_frame)
DCEI.LogMessage("The number of child frames for 'hscroll_frame': " .. child_frame_count)

InGameUILayoutComponent CreateButtonFrame(InGameUILayoutComponent parent)

InGameUILayoutComponent CreateButtonFrame(InGameUILayoutComponent parent)

Description


Creates a new button frame. By default, new buttons use a SetFramePadding of 12 and btn_green as their SetFrameImage. This frame type has a default size of 0 and expands to fit any children.

Parameters

Example Usage

local button = DCEI.CreateButtonFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(button, 120, 50)

InGameUILayoutComponent CreateTextFrame(InGameUILayoutComponent parent)

InGameUILayoutComponent CreateTextFrame(InGameUILayoutComponent parent)

Description


Creates a new text frame. This frame type has a default size of 0 and expand to fit any children.

Parameters

Example Usage

local text = DCEI.CreateTextFrame(button)
DCEI.SetTextFrameText(text, "Button")

InGameUILayoutComponent CreateUserInputTextFrame(InGameUILayoutComponent parent)

InGameUILayoutComponent CreateUserInputTextFrame(InGameUILayoutComponent parent)

Description


Creates a new text frame that handles user inputted text with support for local keyboard data. This should be used to display any text that results from user input, such as a user-created username. This frame type has a default size of 0 and expand to fit any children.

Parameters

Example Usage

local input_text = DCEI.CreateUserInputTextFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(input_text, 200, 50)
DCEI.SetUserInputTextFrameText(input_text, "pretend I'm user input text")

InGameUILayoutComponent CreateInputFrame(InGameUILayoutComponent parent)

InGameUILayoutComponent CreateInputFrame(InGameUILayoutComponent parent)

Description


Creates an input UI frame. By default, this frame type attempts to fill its parent size unless given explicit dimensions.

Parameters

Example Usage

local input = DCEI.CreateInputFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(input, 300, 50)

InGameUILayoutComponent CreateFrameFromXml(InGameUILayoutComponent parent, string name)

InGameUILayoutComponent CreateFrameFromXml(InGameUILayoutComponent parent, string name)

Description


Creates new UI frame given an XML UI element name. XML UI elements are created in the UI Editor Window.

Parameters

Example Usage

-- Creates the UI frame defined in Data/UI Tab as "MyCustomUi"
local custom_ui_frame = DCEI.CreateFrameFromXml(DCEI.GetUiRootFrame(), "MyCustomUi")

Children frames can be referenced with DCEI.GetChildFrameById

void UpdateFrame(InGameUILayoutComponent ui, object callback)

void UpdateFrame(InGameUILayoutComponent ui, object callback)

Description


Used to help safely update inactive UI frames. Creating new UI frames should only be done when the parent frame (and all of its ancestors) are active to ensure the child's internal state is properly initialized. This API helps by enabling the given UI frame (and all of its ancestors), running the given callback function, and then restoring the original active state of the given UI frame.

Parameters

Example Usage

local inactive_parent = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameActive(inactive_parent, false)

local function CreateChildFrame()
  DCEI.CreateFrame(inactive_parent)
end

DCEI.UpdateFrame(inactive_parent, CreateChildFrame)

object GetFrameState(InGameUILayoutComponent ui)

object GetFrameState(InGameUILayoutComponent ui)

Description


Returns the XML UI state as a table for the given UI element. Updating the table values in script will update the state of the UI element.

Parameters

Example Usage

local custom_ui_frame = DCEI.CreateFrameFromXml(DCEI.GetUiRootFrame(), "MyCustomUi")
local state = DCEI.GetFrameState(custom_ui_frame)

-- updates any lua state conditions defined in the XML element that use the `mode` state
state.mode = "default"

object GetFrameController(InGameUILayoutComponent ui)

object GetFrameController(InGameUILayoutComponent ui)

Description


See UI Controllers. Gets the Lua script responsible for controlling UI frame.

Parameters

Example Usage


See UI Controllers

<Frame layout="flex" controller="controller" >
    <Frame width="400" height="400" backgroundImage="golden_pass_overview" />
</Frame>
-- In trigger.lua.txt
function CreateUi()
    local ui = DCEI.CreateFrameFromXml(DCEI.GetUiRootFrame(), "GoldenPass")
    -- Get a reference to the controller object.
    local controller = DCEI.GetFrameController(ui)
    while true do
        -- Call public functions defined on the controller object.
        controller:Animate()
        DCEI.Wait(2)
    end
end

-- In controller.lua.txt
return function(ui)
    local controller = {}

    -- Define handlers of OnEnable/OnDisable event.
    -- This implementation adds a floating animation to the UI frame.
    function controller:OnEnable()
        DCEI.LogMessage("Enable")
    end
    function controller:OnDisable()
        DCEI.LogMessage("Disable")
    end

    -- Define the public interface of this controller. This one only has a single Animate function.
    function controller:Animate()
    local s1, s2 = { x = 1, y = 1, z = 1 }, { x = 0.8, y = 0.8, z = 0.8 }
    local duration = 1
    local ease = "Linear"
    local size_anim = DCEI.AnimateFrameScale(ui, s1, s2, duration, ease)
    end

    -- This OnPreview function will be called automatically when viewed in the UI previewer.
    function controller:OnPreview()
        DCEI.LogMessage("Preview")
    end

    return controller
end

InGameUILayoutComponent GetChildFrameById(InGameUILayoutComponent ui, string id)

InGameUILayoutComponent GetChildFrameById(InGameUILayoutComponent ui, string id)

Description


Returns XML UI frames by their ID. Useful for accessing child frames of an XML UI frame.

Parameters

Example Usage

local parent = DCEI.CreateFrameFromXml(DCEI.GetUiRootFrame(), "MyCustomUi")
local button_frame = DCEI.GetChildFrameById(parent, "button")

Source XML (MyCustomUi)

<HStack>
    <Frame backgroundImage="banner03_gray" padding="40">
        <Text id="text" text="left" color="r: 1, g: 0.5, b: 1"/>
    </Frame>
    <Button id="button" backgroundImage="arrow01_r" width="72" height="94"/>
</HStack>

string GetXmlConstant(string name)

string GetXmlConstant(string name)

Description


Gets the value of a constant, as defined in the UI xml data.

Parameters

Example Usage


image

    local my_color = DCEI.GetXmlConstant("ConstantColor)
    DCEI.LogMessage(my_color) -- will print "#ff00ffff" to log

object GetXmlFrames()

object GetXmlFrames()

Description


Returns a table of all XML UI frames defined in the Data Window. Note that this only returns the top level frames and not their children.

Example Usage

-- Returns a list of all XML frames created in data
local frames = DCEI.GetXmlFrames()
--[[
    Output format:
{ 
    [1] = { 
        ["frame_type"] = Frame,
        ["name"] = Frame,
    } ,
    [2] = { 
        ["frame_type"] = Frame,
        ["name"] = block,
    } ,
} 
]]

-- Returns a list of the parent frame and child frames of "card" - the parent frame "card" will be the first frame in the list
local children = DCEI.GetChildrenFramesIdAndFrameType(card)
-- The output format is the same as GetXmlFrames()

object GetChildrenFramesIdAndFrameType(InGameUILayoutComponent ui)

object GetChildrenFramesIdAndFrameType(InGameUILayoutComponent ui)

Description


Returns a table of child XML UI frames.

Parameters

Example Usage

local parent = DCEI.CreateFrameFromXml(DCEI.GetUiRootFrame(), "MyCustomUi")
local child_frames = DCEI.GetChildrenFramesIdAndFrameType(parent)

bool IsUiRootFrame(InGameUILayoutComponent ui)

bool IsUiRootFrame(InGameUILayoutComponent ui)

Description


Returns true if the given UI frame is a top-level XML UI frame.

Parameters

Example Usage

local parent = DCEI.CreateFrameFromXml(DCEI.GetUiRootFrame(), "MyCustomUi")

local xml_root = DCEI.IsUiRootFrame(parent)
DCEI.LogMessage(tostring(xml_root))

void SetCameraFrameViewportSize(InGameUILayoutComponent ui, int x, int y, bool discardDepth = False)

void SetCameraFrameViewportSize(InGameUILayoutComponent ui, int x, int y, bool discardDepth = False)

Description


Sets the resolution of a camera frame UI. The resolution values are not capped, but excessively high resolutions will consume large amounts of RAM. The default resolution is 0.

Parameters

Example Usage

local unit = DCEI.CreateUnit(1, 1, DCEI.Unit("Standard MeleeUnit"), 16, 12, 0, -1)

local container = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameImage(container, DCEI.Texture("frame01"))
DCEI.SetFramePadding(container, 10)
DCEI.SetFrameTopAlignmentInParent(container)
DCEI.SetFrameLeftAlignmentInParent(container)

local camera = DCEI.CreateCameraFrame(container)
DCEI.SetFrameSize(camera, 150, 150)
DCEI.SetCameraFrameViewportSize(camera, 200, 200)
DCEI.SetCameraFrameViewportWorldPosition(camera, 16, 1, 11)
DCEI.SetCameraFrameViewportRotation(camera, 35, 0, 0)

DCEI.TriggerAddTimerEventElapsed(
    function()
        DCEI.SetCameraFrameViewportSize(camera, 50, 50)
    end,
    1, true
)

void SetCameraFrameViewportWorldPosition(InGameUILayoutComponent ui, float x, float y, float z)

void SetCameraFrameViewportWorldPosition(InGameUILayoutComponent ui, float x, float y, float z)

Description


Sets the position of a camera frame UI. The default position for a new camera frame is {0, 0, 0}.

Parameters

Example Usage

local unit = DCEI.CreateUnit(1, 1, DCEI.Unit("Standard MeleeUnit"), 16, 12, 0, -1)

local container = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameImage(container, DCEI.Texture("frame01"))
DCEI.SetFramePadding(container, 10)
DCEI.SetFrameTopAlignmentInParent(container)
DCEI.SetFrameLeftAlignmentInParent(container)

local camera = DCEI.CreateCameraFrame(container)
DCEI.SetFrameSize(camera, 150, 150)
DCEI.SetCameraFrameViewportSize(camera, 200, 200)
DCEI.SetCameraFrameViewportWorldPosition(camera, 16, 1, 11)
DCEI.SetCameraFrameViewportRotation(camera, 35, 0, 0)

DCEI.TriggerAddTimerEventElapsed(
    function()
        DCEI.SetCameraFrameViewportWorldPosition(camera, 16, 1, 10)
    end,
    1, true
)

void SetCameraFrameViewportRotation(InGameUILayoutComponent ui, float x, float y, float z)

void SetCameraFrameViewportRotation(InGameUILayoutComponent ui, float x, float y, float z)

Description


Sets the rotation of a camera frame UI. The default rotation for a new camera frame is {0, 0, 0}.

Parameters

Example Usage

local unit = DCEI.CreateUnit(1, 1, DCEI.Unit("Standard MeleeUnit"), 16, 12, 0, -1)

local container = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameImage(container, DCEI.Texture("frame01"))
DCEI.SetFramePadding(container, 10)
DCEI.SetFrameTopAlignmentInParent(container)
DCEI.SetFrameLeftAlignmentInParent(container)

local camera = DCEI.CreateCameraFrame(container)
DCEI.SetFrameSize(camera, 150, 150)
DCEI.SetCameraFrameViewportSize(camera, 200, 200)
DCEI.SetCameraFrameViewportWorldPosition(camera, 16, 1, 11)
DCEI.SetCameraFrameViewportRotation(camera, 35, 0, 0)

DCEI.TriggerAddTimerEventElapsed(
    function()
        DCEI.SetCameraFrameViewportRotation(camera, 35, 30, 0)
    end,
    1, true
)

void SetGridFrameCellWidth(InGameUILayoutComponent ui, float width)

void SetGridFrameCellWidth(InGameUILayoutComponent ui, float width)

Description


Sets the cell width for a grid.

Parameters

Example Usage

local grid = DCEI.CreateGridFrame(DCEI.GetUiRootFrame())
DCEI.SetGridFrameCellHeight(grid, 100)
DCEI.SetGridFrameCellWidth(grid, 100)
DCEI.SetFrameSize(grid, 200, 200)

local content1 = DCEI.CreateTextFrame(grid)
DCEI.SetTextFrameText(content1, "a")
DCEI.SetFrameSize(content1, 100, 100)
local content2 = DCEI.CreateTextFrame(grid)
DCEI.SetTextFrameText(content2, "b")
DCEI.SetFrameSize(content2, 100, 100)
local content3 = DCEI.CreateTextFrame(grid)
DCEI.SetTextFrameText(content3, "c")
DCEI.SetFrameSize(content3, 100, 100)
local content4 = DCEI.CreateTextFrame(grid)
DCEI.SetTextFrameText(content4, "d")
DCEI.SetFrameSize(content4, 100, 100)

void SetGridFrameCellHeight(InGameUILayoutComponent ui, float height)

void SetGridFrameCellHeight(InGameUILayoutComponent ui, float height)

Description


Sets the cell height for a grid.

Parameters

Example Usage

local grid = DCEI.CreateGridFrame(DCEI.GetUiRootFrame())
DCEI.SetGridFrameCellHeight(grid, 100)
DCEI.SetGridFrameCellWidth(grid, 100)
DCEI.SetFrameSize(grid, 200, 200)

local content1 = DCEI.CreateTextFrame(grid)
DCEI.SetTextFrameText(content1, "a")
DCEI.SetFrameSize(content1, 100, 100)
local content2 = DCEI.CreateTextFrame(grid)
DCEI.SetTextFrameText(content2, "b")
DCEI.SetFrameSize(content2, 100, 100)
local content3 = DCEI.CreateTextFrame(grid)
DCEI.SetTextFrameText(content3, "c")
DCEI.SetFrameSize(content3, 100, 100)
local content4 = DCEI.CreateTextFrame(grid)
DCEI.SetTextFrameText(content4, "d")
DCEI.SetFrameSize(content4, 100, 100)

Tweener AnimateCameraFrameViewportWorldPosition(InGameUILayoutComponent ui, float x, float y, float z, float duration, Ease ease)

Tweener AnimateCameraFrameViewportWorldPosition(InGameUILayoutComponent ui, float x, float y, float z, float duration, Ease ease)

Description


Animates a camera frame UI to a new position. Returns the UI animation for use in SetFrameAnimationLoops and StopFrameAnimation.

Parameters

Example Usage

local unit = DCEI.CreateUnit(1, 1, DCEI.Unit("Standard MeleeUnit"), 16, 12, 0, -1)

local container = DCEI.CreateVStackFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameImage(container, DCEI.Texture("frame01"))
DCEI.SetFramePadding(container, 10)
DCEI.SetFrameTopAlignmentInParent(container)
DCEI.SetFrameLeftAlignmentInParent(container)

local camera = DCEI.CreateCameraFrame(container)
DCEI.SetFrameSize(camera, 150, 150)
DCEI.SetCameraFrameViewportSize(camera, 200, 200)
DCEI.SetCameraFrameViewportWorldPosition(camera, 16, 1, 11)
DCEI.SetCameraFrameViewportRotation(camera, 35, 0, 0)

local btn = DCEI.CreateButtonFrame(container)
DCEI.SetFrameSize(btn, 150, 80)
DCEI.SetOnClickCallback(btn, OnClick)

local text = DCEI.CreateTextFrame(btn)
DCEI.SetTextFrameText(text, "Animate")

local state = 0
DCEI.SetOnClickCallback(
    btn,
    function()
        local duration =  0.25
        local ease = "Linear"

        if state == 0 then
            DCEI.AnimateCameraFrameViewportWorldPosition(camera, 16, 0.75, 11.5, duration, ease)
            state = 1
        else
            DCEI.AnimateCameraFrameViewportWorldPosition(camera, 16, 1, 11, duration, ease)
            state = 0
        end
    end
)

Tweener AnimateCameraFrameViewportRotation(InGameUILayoutComponent ui, float x, float y, float z, float duration, Ease ease)

Tweener AnimateCameraFrameViewportRotation(InGameUILayoutComponent ui, float x, float y, float z, float duration, Ease ease)

Description

Parameters

Example Usage

local unit = DCEI.CreateUnit(1, 1, DCEI.Unit("Standard MeleeUnit"), 16, 12, 0, -1)

local container = DCEI.CreateVStackFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameImage(container, DCEI.Texture("frame01"))
DCEI.SetFramePadding(container, 10)
DCEI.SetFrameTopAlignmentInParent(container)
DCEI.SetFrameLeftAlignmentInParent(container)

local camera = DCEI.CreateCameraFrame(container)
DCEI.SetFrameSize(camera, 150, 150)
DCEI.SetCameraFrameViewportSize(camera, 200, 200)
DCEI.SetCameraFrameViewportOrthographic(camera, true)
DCEI.SetCameraFrameOrthographicViewportSize(camera, 1)
DCEI.SetCameraFrameViewportWorldPosition(camera, 16, 1, 11)
DCEI.SetCameraFrameViewportRotation(camera, 35, 0, 0)

DCEI.AnimateCameraFrameViewportRotation(camera, 60, 30, 10, 3, "Linear")

Tweener AnimateCameraFrameOrthographicViewportSize(InGameUILayoutComponent ui, float size, float duration, Ease ease)

Tweener AnimateCameraFrameOrthographicViewportSize(InGameUILayoutComponent ui, float size, float duration, Ease ease)

Description


Animates a camera frame UI to a new orthographic size. Returns the UI animation for use in SetFrameAnimationLoops and StopFrameAnimation.

Parameters

Example Usage

local unit = DCEI.CreateUnit(1, 1, DCEI.Unit("Standard MeleeUnit"), 16, 12, 0, -1)

local container = DCEI.CreateVStackFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameImage(container, DCEI.Texture("frame01"))
DCEI.SetFramePadding(container, 10)
DCEI.SetFrameTopAlignmentInParent(container)
DCEI.SetFrameLeftAlignmentInParent(container)

local camera = DCEI.CreateCameraFrame(container)
DCEI.SetFrameSize(camera, 150, 150)
DCEI.SetCameraFrameViewportSize(camera, 200, 200)
DCEI.SetCameraFrameViewportOrthographic(camera, true)
DCEI.SetCameraFrameOrthographicViewportSize(camera, 1)
DCEI.SetCameraFrameViewportWorldPosition(camera, 16, 1, 11)
DCEI.SetCameraFrameViewportRotation(camera, 35, 0, 0)

DCEI.AnimateCameraFrameOrthographicViewportSize(camera, 2, 5, "Linear")

void SetCameraFrameCullingMask(InGameUILayoutComponent ui, int mask)

void SetCameraFrameCullingMask(InGameUILayoutComponent ui, int mask)

Description


Sets a culling mask for a camera frame that can be used to remove rendering layers from a camera frame.

Parameters

Example Usage

local unit = DCEI.CreateUnit(1, 1, DCEI.Unit("Standard MeleeUnit"), 16, 12, 0, -1)

local container = DCEI.CreateVStackFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameImage(container, DCEI.Texture("frame01"))
DCEI.SetFramePadding(container, 10)
DCEI.SetFrameTopAlignmentInParent(container)
DCEI.SetFrameLeftAlignmentInParent(container)

local camera = DCEI.CreateCameraFrame(container)
DCEI.SetFrameSize(camera, 150, 150)
DCEI.SetCameraFrameViewportSize(camera, 200, 200)
DCEI.SetCameraFrameViewportWorldPosition(camera, 16, 1, 11)
DCEI.SetCameraFrameViewportRotation(camera, 35, 0, 0)
DCEI.SetCameraFrameCullingMask(camera, 1)

void SetCameraFrameBackgroundColor(InGameUILayoutComponent ui, ColorRGBA color)

void SetCameraFrameBackgroundColor(InGameUILayoutComponent ui, ColorRGBA color)

Description


Set background color for a camera frame.

Parameters

Example Usage

local camera = DCEI.CreateCameraFrame(container)
DCEI.SetCameraFrameBackgroundColor(camera, {r = 0.5, g = 0.5, b = 0, a = 0.5})

void SetCameraFrameViewportOrthographic(InGameUILayoutComponent ui, bool set)

void SetCameraFrameViewportOrthographic(InGameUILayoutComponent ui, bool set)

Description


Enables orthographic view for a camera frame. Note that orthographic camera size must be set independently using DCEI.SetCameraFrameOrthographicViewportSize().

Parameters

Example Usage

local unit = DCEI.CreateUnit(1, 1, DCEI.Unit("Standard MeleeUnit"), 16, 12, 0, -1)

local container = DCEI.CreateVStackFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameImage(container, DCEI.Texture("frame01"))
DCEI.SetFramePadding(container, 10)
DCEI.SetFrameTopAlignmentInParent(container)
DCEI.SetFrameLeftAlignmentInParent(container)

local camera = DCEI.CreateCameraFrame(container)
DCEI.SetFrameSize(camera, 150, 150)
DCEI.SetCameraFrameViewportSize(camera, 200, 200)
DCEI.SetCameraFrameViewportWorldPosition(camera, 16, 1, 11)
DCEI.SetCameraFrameViewportRotation(camera, 35, 0, 0)
DCEI.SetCameraFrameViewportOrthographic(camera, true)
DCEI.SetCameraFrameOrthographicViewportSize(camera, 1)

void SetCameraFrameOrthographicViewportSize(InGameUILayoutComponent ui, float size)

void SetCameraFrameOrthographicViewportSize(InGameUILayoutComponent ui, float size)

Description


Sets the orthographic size for a camera frame.

Parameters

Example Usage

local unit = DCEI.CreateUnit(1, 1, DCEI.Unit("Standard MeleeUnit"), 16, 12, 0, -1)

local container = DCEI.CreateVStackFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameImage(container, DCEI.Texture("frame01"))
DCEI.SetFramePadding(container, 10)
DCEI.SetFrameTopAlignmentInParent(container)
DCEI.SetFrameLeftAlignmentInParent(container)

local camera = DCEI.CreateCameraFrame(container)
DCEI.SetFrameSize(camera, 150, 150)
DCEI.SetCameraFrameViewportSize(camera, 200, 200)
DCEI.SetCameraFrameViewportWorldPosition(camera, 16, 1, 11)
DCEI.SetCameraFrameViewportRotation(camera, 35, 0, 0)
DCEI.SetCameraFrameViewportOrthographic(camera, true)
DCEI.SetCameraFrameOrthographicViewportSize(camera, 1)

DCEI.TriggerAddTimerEventElapsed(
    function()
        DCEI.SetCameraFrameOrthographicViewportSize(camera, 2)
    end,
    1, true
)

InGameUILayoutComponent CreateMiniMapFrame(InGameUILayoutComponent parent, bool hideTerrain = False)

InGameUILayoutComponent CreateMiniMapFrame(InGameUILayoutComponent parent, bool hideTerrain = False)

Description


Creates a minimap frame. Use CameraFrame functions to modify the frame. The default resolution for the minimap is 1x1.

Parameters

Example Usage

local minimap = DCEI.CreateMiniMapFrame(DCEI.GetUiRootFrame(), false)
DCEI.SetCameraFrameViewportSize(minimap, 500, 500)
DCEI.SetFrameSize(minimap, 200, 200)

void SetCameraFrameEffectColor(InGameUILayoutComponent ui, ColorRGB color, float saturation, float contrast, float brightness)

void SetCameraFrameEffectColor(InGameUILayoutComponent ui, ColorRGB color, float saturation, float contrast, float brightness)

Description


Set effect color for a camera frame.

Parameters

Example Usage

local camera = DCEI.CreateCameraFrame(container)
DCEI.SetCameraFrameEffectColor(camera, {r = 0.5, g = 0.5, b = 0}, 1, 0.5, 1)

InGameUILayoutComponent GetScrollFrameContent(InGameUILayoutComponent parent)

InGameUILayoutComponent GetScrollFrameContent(InGameUILayoutComponent parent)

Description


Returns the content frame of a scroll frame.

Parameters

Example Usage

local scroll = DCEI.CreateScrollFrame(DCEI.GetUiRootFrame())
local content = DCEI.GetScrollFrameContent(scroll)

void SetScrollFrameScrollPosition(InGameUILayoutComponent ui, float position)

void SetScrollFrameScrollPosition(InGameUILayoutComponent ui, float position)

Description


Sets the scroll position for an CreateHScrollFrame or CreateVScrollFrame frames.

Parameters

Example Usage

local vscroll_frame = DCEI.CreateVScrollFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(vscroll_frame, 200, 300)
DCEI.SetFrameImageColor(vscroll_frame, {r = 1, g = 0, b = 0, a = 0.3})
DCEI.SetScrollFrameScrollPosition(vscroll_frame, 300)

local content = DCEI.GetScrollFrameContent(vscroll_frame)
local frame1 = DCEI.CreateFrame(content)
DCEI.SetFrameSize(frame1, 150, 400)
DCEI.SetFrameImageColor(frame1, {r = 1, g = 0, b = 0, a = 1})

local frame2 = DCEI.CreateFrame(content)
DCEI.SetFrameSize(frame2, 150, 400)
DCEI.SetFrameImageColor(frame2, {r = 0, g = 0, b = 1, a = 1})

float GetScrollFrameScrollPosition(InGameUILayoutComponent ui)

float GetScrollFrameScrollPosition(InGameUILayoutComponent ui)

Description


Returns the position of a scroll frame.

Parameters

Example Usage

local vscroll_frame = DCEI.CreateVScrollFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(vscroll_frame, 200, 300)
DCEI.SetFrameImageColor(vscroll_frame, {r = 1, g = 0, b = 0, a = 0.3})
DCEI.SetScrollFrameScrollPosition(vscroll_frame, 300)

local content = DCEI.GetScrollFrameContent(vscroll_frame)
local frame1 = DCEI.CreateFrame(content)
DCEI.SetFrameSize(frame1, 150, 400)
DCEI.SetFrameImageColor(frame1, {r = 1, g = 0, b = 0, a = 1})

local frame2 = DCEI.CreateFrame(content)
DCEI.SetFrameSize(frame2, 150, 400)
DCEI.SetFrameImageColor(frame2, {r = 0, g = 0, b = 1, a = 1})

local scroll_pos = DCEI.GetScrollFrameScrollPosition(vscroll_frame)
DCEI.LogMessage(scroll_pos)

void SetScrollFrameScrollPosition2D(InGameUILayoutComponent ui, Float2 position)

void SetScrollFrameScrollPosition2D(InGameUILayoutComponent ui, Float2 position)

Description


Sets the position of a CreateScrollFrame frame.

Parameters

Example Usage

local scroll = DCEI.CreateScrollFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(scroll, 500, 500)
DCEI.SetFrameImageColor(scroll, {r = 1, g = 0, b = 0, a = 0.3})

local content = DCEI.GetScrollFrameContent(scroll)
local big_content = DCEI.CreateFrame(content)
DCEI.SetFrameSize(big_content, 1000, 1000)
DCEI.SetFrameImageColor(big_content, {r = 0, g = 0, b = 1, a = 0.4})

local small_content = DCEI.CreateFrame(content)
DCEI.SetFrameSize(small_content, 100, 100)
DCEI.SetFrameImageColor(small_content, {r = 0, g = 1, b = 0, a = 0.4})

DCEI.SetScrollFrameScrollPosition2D(scroll, {x = 0, y = 500})

Float2 GetScrollFrameScrollPosition2D(InGameUILayoutComponent ui)

Float2 GetScrollFrameScrollPosition2D(InGameUILayoutComponent ui)

Description


Returns the position of a CreateScrollFrame frame.

Parameters

Example Usage

local scroll = DCEI.CreateScrollFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(scroll, 500, 500)
DCEI.SetFrameImageColor(scroll, {r = 1, g = 0, b = 0, a = 0.3})

local content = DCEI.GetScrollFrameContent(scroll)
local big_content = DCEI.CreateFrame(content)
DCEI.SetFrameSize(big_content, 1000, 1000)
DCEI.SetFrameImageColor(big_content, {r = 0, g = 0, b = 1, a = 0.4})

local small_content = DCEI.CreateFrame(content)
DCEI.SetFrameSize(small_content, 100, 100)
DCEI.SetFrameImageColor(small_content, {r = 0, g = 1, b = 0, a = 0.4})
DCEI.SetScrollFrameScrollPosition2D(scroll, {x = 0, y = 500})

local scroll_pos = DCEI.GetScrollFrameScrollPosition2D(scroll)
DCEI.LogMessage("Scroll X position: " .. scroll_pos.x .. "\nScroll Y position: " .. scroll_pos.y)

void SetScrollFrameScrollInertia(InGameUILayoutComponent ui, bool value)

void SetScrollFrameScrollInertia(InGameUILayoutComponent ui, bool value)

Description


Sets the inertia for a scroll frame. This is supported for all scroll frame types.

Parameters

Example Usage

local scroll = DCEI.CreateScrollFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(scroll, 500, 500)
DCEI.SetFrameImageColor(scroll, {r = 1, g = 0, b = 0, a = 0.3})
DCEI.SetScrollFrameScrollInertia(scroll, false)

local content = DCEI.GetScrollFrameContent(scroll)
local big_content = DCEI.CreateFrame(content)
DCEI.SetFrameSize(big_content, 1000, 1000)
DCEI.SetFrameImageColor(big_content, {r = 0, g = 0, b = 1, a = 0.4})

local small_content = DCEI.CreateFrame(content)
DCEI.SetFrameSize(small_content, 100, 100)
DCEI.SetFrameImageColor(small_content, {r = 0, g = 1, b = 0, a = 0.4})

void SetScrollFrameScrollEnable(InGameUILayoutComponent ui, bool value)

void SetScrollFrameScrollEnable(InGameUILayoutComponent ui, bool value)

Description


Sets whether scrolling is enabled. This is supported for all scroll frame types.

Parameters

Example Usage

local scroll = DCEI.CreateScrollFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(scroll, 500, 500)
DCEI.SetFrameImageColor(scroll, {r = 1, g = 0, b = 0, a = 0.3})
DCEI.SetScrollFrameScrollEnable(scroll, false)

local content = DCEI.GetScrollFrameContent(scroll)
local big_content = DCEI.CreateFrame(content)
DCEI.SetFrameSize(big_content, 1000, 1000)
DCEI.SetFrameImageColor(big_content, {r = 0, g = 0, b = 1, a = 0.4})

local small_content = DCEI.CreateFrame(content)
DCEI.SetFrameSize(small_content, 100, 100)
DCEI.SetFrameImageColor(small_content, {r = 0, g = 1, b = 0, a = 0.4})

void SetScrollFrameScrollDecelerationRate(InGameUILayoutComponent ui, float value)

void SetScrollFrameScrollDecelerationRate(InGameUILayoutComponent ui, float value)

Description


Sets the deceleration rate for scroll inertia. A value of 0 will cause instant deceleration (equivalent to setting the inertia to false). Values between 0 and 1 will cause deceleration. A value of 1 will cause no deceleration. A value greater than 1 will cause acceleration. A negative value will break the scroll element. This is supported for all scroll frame types.

Parameters

Example Usage

local scroll = DCEI.CreateScrollFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(scroll, 500, 500)
DCEI.SetFrameImageColor(scroll, {r = 1, g = 0, b = 0, a = 0.3})
DCEI.SetScrollFrameScrollDecelerationRate(scroll, 0.5)

local content = DCEI.GetScrollFrameContent(scroll)
local big_content = DCEI.CreateFrame(content)
DCEI.SetFrameSize(big_content, 1000, 1000)
DCEI.SetFrameImageColor(big_content, {r = 0, g = 0, b = 1, a = 0.4})

local small_content = DCEI.CreateFrame(content)
DCEI.SetFrameSize(small_content, 100, 100)
DCEI.SetFrameImageColor(small_content, {r = 0, g = 1, b = 0, a = 0.4})

void SetScrollFrameScrollContentAlignment(InGameUILayoutComponent ui, string value)

void SetScrollFrameScrollContentAlignment(InGameUILayoutComponent ui, string value)

Description


Sets the alignment for scroll content. The value determines where the initial display location of the scroll content is.

Parameters

Example Usage

local vscroll_frame = DCEI.CreateVScrollFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(vscroll_frame, 200, 500)
DCEI.SetScrollFrameScrollContentAlignment(vscroll_frame, "right")

void SetScrollFrameSnapEnabled(InGameUILayoutComponent ui, bool value)

void SetScrollFrameSnapEnabled(InGameUILayoutComponent ui, bool value)

Description


Toggles scroll frame snapping on or off. When enabled, there are a suite of other APIs for adjusting the snap step size, step count, threshold, and speed. These APIs are useful if your scroll frame contains items of discrete sizes and you want your scroll frame to always snap to these elements rather then end up partially between two items.

Parameters

Example Usage

local GMUI = require("GMUI")

function InitializeScrollFrame()
    -- Assuming "ScrollFrame" is an HScroll containing items 200 wide with spacing & padding of 15
    local scroll = GMUI.Layout.New({ name = "ScrollFrame" })
    local count = DCEI.GetChildrenFrameCount(scroll.Frame)

    DCEI.SetScrollFrameScrollDecelerationRate(scroll.Frame, 0.5)

    DCEI.SetScrollFrameSnapEnabled(scroll.Frame, true)
    DCEI.SetScrollFrameSnapStepSize(scroll.Frame, 215)
    DCEI.SetScrollFrameSnapStepCount(scroll.Frame, count)
    DCEI.SetScrollFrameSnapThreshold(scroll.Frame, 215)
    DCEI.SetScrollFrameSnapSpeed(scroll.Frame, 125)
end

InitializeScrollFrame()

void SetScrollFrameSnapStepSize(InGameUILayoutComponent ui, float value)

void SetScrollFrameSnapStepSize(InGameUILayoutComponent ui, float value)

Description


Sets the size of steps between snap points on scroll frame snapping. Most likely, you'll want to set this to the width of individual items within the scroll frame.

Parameters

Example Usage

local GMUI = require("GMUI")

function InitializeScrollFrame()
    -- Assuming "ScrollFrame" is an HScroll containing items 200 wide with spacing & padding of 15
    local scroll = GMUI.Layout.New({ name = "ScrollFrame" })
    local count = DCEI.GetChildrenFrameCount(scroll.Frame)

    DCEI.SetScrollFrameScrollDecelerationRate(scroll.Frame, 0.5)

    DCEI.SetScrollFrameSnapEnabled(scroll.Frame, true)
    DCEI.SetScrollFrameSnapStepSize(scroll.Frame, 215)
    DCEI.SetScrollFrameSnapStepCount(scroll.Frame, count)
    DCEI.SetScrollFrameSnapThreshold(scroll.Frame, 215)
    DCEI.SetScrollFrameSnapSpeed(scroll.Frame, 125)
end

InitializeScrollFrame()

void SetScrollFrameSnapStepCount(InGameUILayoutComponent ui, int value)

void SetScrollFrameSnapStepCount(InGameUILayoutComponent ui, int value)

Description


Sets the number of steps. In the most common use case, you would want to set this to the number of children items, most likely by using GetChildrenFrameCount.

Parameters

Example Usage

local GMUI = require("GMUI")

function InitializeScrollFrame()
    -- Assuming "ScrollFrame" is an HScroll containing items 200 wide with spacing & padding of 15
    local scroll = GMUI.Layout.New({ name = "ScrollFrame" })
    local count = DCEI.GetChildrenFrameCount(scroll.Frame)

    DCEI.SetScrollFrameScrollDecelerationRate(scroll.Frame, 0.5)

    DCEI.SetScrollFrameSnapEnabled(scroll.Frame, true)
    DCEI.SetScrollFrameSnapStepSize(scroll.Frame, 215)
    DCEI.SetScrollFrameSnapStepCount(scroll.Frame, count)
    DCEI.SetScrollFrameSnapThreshold(scroll.Frame, 215)
    DCEI.SetScrollFrameSnapSpeed(scroll.Frame, 125)
end

InitializeScrollFrame()

void SetScrollFrameSnapThreshold(InGameUILayoutComponent ui, float value)

void SetScrollFrameSnapThreshold(InGameUILayoutComponent ui, float value)

Description


Sets the threshold for scroll frame snapping. The threshold is how close a user has to scroll to the next step before they will snap to that step instead of the previous one.

Parameters

Example Usage

local GMUI = require("GMUI")

function InitializeScrollFrame()
    -- Assuming "ScrollFrame" is an HScroll containing items 200 wide with spacing & padding of 15
    local scroll = GMUI.Layout.New({ name = "ScrollFrame" })
    local count = DCEI.GetChildrenFrameCount(scroll.Frame)

    DCEI.SetScrollFrameScrollDecelerationRate(scroll.Frame, 0.5)

    DCEI.SetScrollFrameSnapEnabled(scroll.Frame, true)
    DCEI.SetScrollFrameSnapStepSize(scroll.Frame, 215)
    DCEI.SetScrollFrameSnapStepCount(scroll.Frame, 1)
    DCEI.SetScrollFrameSnapThreshold(scroll.Frame, 215)
    DCEI.SetScrollFrameSnapSpeed(scroll.Frame, 125)
end

InitializeScrollFrame()

void SetScrollFrameSnapSpeed(InGameUILayoutComponent ui, float value)

void SetScrollFrameSnapSpeed(InGameUILayoutComponent ui, float value)

Description


Set how fast the snapping to the next step will occur for scroll frames with snapping enabled.

Parameters

Example Usage

local GMUI = require("GMUI")

function InitializeScrollFrame()
    -- Assuming "ScrollFrame" is an HScroll containing items 200 wide with spacing & padding of 15
    local scroll = GMUI.Layout.New({ name = "ScrollFrame" })
    local count = DCEI.GetChildrenFrameCount(scroll.Frame)

    DCEI.SetScrollFrameScrollDecelerationRate(scroll.Frame, 0.5)

    DCEI.SetScrollFrameSnapEnabled(scroll.Frame, true)
    DCEI.SetScrollFrameSnapStepSize(scroll.Frame, 215)
    DCEI.SetScrollFrameSnapStepCount(scroll.Frame, count)
    DCEI.SetScrollFrameSnapThreshold(scroll.Frame, 215)
    DCEI.SetScrollFrameSnapSpeed(scroll.Frame, 125)
end

InitializeScrollFrame()

void SetTextFrameRtlSupport(InGameUILayoutComponent text, bool value)

void SetTextFrameRtlSupport(InGameUILayoutComponent text, bool value)

Description


Sets RTL (right to left) support for a text frame. When true, this text will be displayed from right-to-left when using RTL languages (such as Arabic). You typically want to disable this for numeric text, which is still displayed as left-to-right in such languages. This is enabled by default on all text frames.

Parameters

Example Usage

local text_frame = DCEI.CreateTextFrame(DCEI.GetUiRootFrame())
DCEI.SetTextFrameRtlSupport(text_frame, false)

void SetTextFrameAlignment(InGameUILayoutComponent text, string alignment)

void SetTextFrameAlignment(InGameUILayoutComponent text, string alignment)

Description


Sets the text alignment for a text frame.

Parameters

Example Usage

local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameImageColor(frame, {r = 1, g = 1, b = 0, a = 0.5})

local text_frame = DCEI.CreateTextFrame(frame)
DCEI.SetTextFrameText(text_frame, "Text")
DCEI.SetFrameSize(text_frame, 200, 100)
DCEI.SetTextFrameAlignment(text_frame, "end")

void SetTextFrameWrapping(InGameUILayoutComponent text, bool enable)

void SetTextFrameWrapping(InGameUILayoutComponent text, bool enable)

Description


Sets text wrapping for a text frame.

Parameters

Example Usage

local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameImageColor(frame, {r = 1, g = 1, b = 0, a = 0.5})

local text_frame = DCEI.CreateTextFrame(frame)
DCEI.SetTextFrameText(text_frame, "Text")
DCEI.SetFrameSize(text_frame, 200, 100)
DCEI.SetTextFrameWrapping(text_frame, false)

void SetTextFrameOverflow(InGameUILayoutComponent text, bool enable)

void SetTextFrameOverflow(InGameUILayoutComponent text, bool enable)

Description


Sets text overflow for a text frame.

Parameters

Example Usage

local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameImageColor(frame, {r = 1, g = 1, b = 0, a = 0.5})

local text_frame = DCEI.CreateTextFrame(frame)
DCEI.SetTextFrameText(text_frame, "Text Overflow Example")
DCEI.SetFrameSize(text_frame, 200, 40)
DCEI.SetTextFrameOverflow(text_frame, false)

void SetTextFrameText(InGameUILayoutComponent text, string content)

void SetTextFrameText(InGameUILayoutComponent text, string content)

Description


Sets the text of a text frame. Supports rich text tags See: http://digitalnativestudios.com/textmeshpro/docs/rich-text/ Use \n for newline.

Parameters

unit.Info.Icon
unit.Info.Name
unit.Health.Current
unit.Health.Max
unit.Health.Percentage
unit.Health.Fraction
unit.Health.Regeneration
unit.Shield.Current
unit.Shield.Max
unit.Shield.Percentage
unit.Shield.Fraction
unit.Shield.Regeneration
unit.Mana.Current
unit.Mana.Max
unit.Mana.Percentage
unit.Mana.Fraction
unit.Mana.Regeneration
unit.Ability.ability_name.CooldownRatio
unit.Ability.ability_name.MaxCharge
unit.Ability.ability_name.ChargeCount
unit.Expression.some_named_expression

Data bound values can be formatted to specific decimal values by appending the expression such as :F2.
(You can find more documentation here)

Example Usage

local text = "Here's some <b>RICH</b> text!" .. "\n" .. 
  "And here's some <size=50%>small</size> text." .. "\n" .. 
  "<color=blue>And here's some blue text.</color>"

local label = DCEI.CreateTextFrame(DCEI.GetUiRootFrame())
DCEI.SetTextFrameText(label, text)

void SetTextFrameTextExpression(InGameUILayoutComponent text, string content)

void SetTextFrameTextExpression(InGameUILayoutComponent text, string content)

Description


Sets a text expression in a text frame. Unlike other UI expressions, text expressions must be surrounded with curly brackets {}. These brackets are used so the expression string can be concatenated with regular text. For a list of fields that can be accessed after the unit is bound, see Data-Binding.

Parameters

Example Usage

-- unit binding for expressions
local unit = DCEI.CreateUnit(1, 1, DCEI.Unit("Standard MeleeUnit"), 16, 16, 0, -1)
DCEI.BindUnitData("selected", unit)

local stats = {}
local vstack = DCEI.CreateVStackFrame(DCEI.GetUiRootFrame())
stats.health_label = DCEI.CreateTextFrame(vstack)
stats.mana_regen_label = DCEI.CreateTextFrame(vstack)

-- make it so that the healthbar shows <current HP>/<max HP>
DCEI.SetTextFrameTextExpression(stats.health_label, "{selected.Health.Current}/{selected.Health.Max}")

-- assuming the selected unit's mana regeneration is 1.228
-- this expression will display 1.2
DCEI.SetTextFrameTextExpression(stats.mana_regen_label, "{selected.Mana.Regeneration:F1}")
-- this expression will display 1.23
DCEI.SetTextFrameTextExpression(stats.mana_regen_label, "{selected.Mana.Regeneration:F2}")

-- data binding for expressions
local data_table = {text = "data bound label"}
DCEI.BindLuaTable("data", data_table)

local data_binding = DCEI.CreateTextFrame(vstack)
DCEI.SetTextFrameTextExpression(data_binding, "{data.text}")

DreamEditor also provides an additional specifier :K to format huge numbers as "xxxK", "xxxM" or "xxxB". The default parameter for :K is :K2.

-- assuming the selected unit's max health is 1000000
-- this expression will display 1M
DCEI.SetTextFrameTextExpression(stats.health_label, "{selected.Health.Max:K0}")
-- this expression will display 1.0M
DCEI.SetTextFrameTextExpression(stats.health_label, "{selected.Health.Max:K1}")

void SetTextFrameFontSize(InGameUILayoutComponent text, float size)

void SetTextFrameFontSize(InGameUILayoutComponent text, float size)

Description


Sets the font size for a text frame. The default font size is 22.

Parameters

Example Usage

local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameImageColor(frame, {r = 1, g = 1, b = 0, a = 0.5})

local text_frame = DCEI.CreateTextFrame(frame)
DCEI.SetTextFrameText(text_frame, "Text")
DCEI.SetFrameSize(text_frame, 200, 100)
DCEI.SetTextFrameFontSize(text_frame, 50)

void SetTextFrameFontSizeMin(InGameUILayoutComponent text, float size)

void SetTextFrameFontSizeMin(InGameUILayoutComponent text, float size)

Description


Sets a minimum font size for a text frame. To enable dynamic font sizing, a text frame needs a minium and maximum font size and either a maximum height or width. Does not work if there is a set font size.

Parameters

Example Usage

local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameImageColor(frame, {r = 1, g = 1, b = 0, a = 0.5})

local text_frame = DCEI.CreateTextFrame(frame)
DCEI.SetTextFrameText(text_frame, "Text")
DCEI.SetTextFrameFontSizeMin(text_frame, 10)
DCEI.SetTextFrameFontSizeMax(text_frame, 30)
DCEI.SetFrameSize(text_frame, 50, 30)

void SetTextFrameFontSizeMax(InGameUILayoutComponent text, float size)

void SetTextFrameFontSizeMax(InGameUILayoutComponent text, float size)

Description


Sets a maximum font size for a text frame. To enable dynamic font sizing, a text frame needs a minium and maximum font size and either a maximum height or width. Does not work if there is a set font size.

Parameters

Example Usage

local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameImageColor(frame, {r = 1, g = 1, b = 0, a = 0.5})

local text_frame = DCEI.CreateTextFrame(frame)
DCEI.SetTextFrameText(text_frame, "Text")
DCEI.SetTextFrameFontSizeMin(text_frame, 10)
DCEI.SetTextFrameFontSizeMax(text_frame, 30)
DCEI.SetFrameSize(text_frame, 100, 30)

void SetTextFrameColor(InGameUILayoutComponent text, ColorRGB color)

void SetTextFrameColor(InGameUILayoutComponent text, ColorRGB color)

Description


Sets the color of text for a text frame.

Parameters

Example Usage

local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameImageColor(frame, {r = 1, g = 1, b = 0, a = 0.5})

local text_frame = DCEI.CreateTextFrame(frame)
DCEI.SetTextFrameText(text_frame, "Text")
DCEI.SetFrameSize(text_frame, 200, 100)
DCEI.SetTextFrameColor(text_frame, {r = 0.5, g = 0.5, b = 0})

void SetTextFrameOutline(InGameUILayoutComponent text, bool outline)

void SetTextFrameOutline(InGameUILayoutComponent text, bool outline)

Description


Sets the outline for a text frame's text.

Parameters

Example Usage

local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameImageColor(frame, {r = 1, g = 1, b = 0, a = 0.5})

local text_frame = DCEI.CreateTextFrame(frame)
DCEI.SetTextFrameText(text_frame, "Text")
DCEI.SetFrameSize(text_frame, 200, 100)
DCEI.SetTextFrameOutline(text_frame, false)

void SetTextFrameShadow(InGameUILayoutComponent text, bool enableShadow)

void SetTextFrameShadow(InGameUILayoutComponent text, bool enableShadow)

Description


Sets the shadow for a text frame's text. Disabling the text shadow will also disable the outline.

Parameters

Example Usage

local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameImageColor(frame, {r = 1, g = 1, b = 0, a = 0.5})

local text_frame = DCEI.CreateTextFrame(frame)
DCEI.SetTextFrameText(text_frame, "Text")
DCEI.SetFrameSize(text_frame, 200, 100)
DCEI.SetTextFrameShadow(text_frame, false)

void SetTextFrameOutlineOutside(InGameUILayoutComponent text, bool outside)

void SetTextFrameOutlineOutside(InGameUILayoutComponent text, bool outside)

Description


Sets the outline for a text frame's text.

Parameters

Example Usage

local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameImageColor(frame, {r = 1, g = 1, b = 0, a = 0.5})

local text_frame = DCEI.CreateTextFrame(frame)
DCEI.SetTextFrameText(text_frame, "Text")
DCEI.SetFrameSize(text_frame, 200, 100)
DCEI.SetTextFrameOutlineOutside(text_frame, true)
DCEI.SetTextFrameOutlineWidth(text_frame, 0.5)

void SetTextFrameOutlineColor(InGameUILayoutComponent text, ColorRGBA color)

void SetTextFrameOutlineColor(InGameUILayoutComponent text, ColorRGBA color)

Description


Sets the outline color for a text frame's text.

Parameters

Example Usage

local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameImageColor(frame, {r = 1, g = 1, b = 0, a = 0.5})

local text_frame = DCEI.CreateTextFrame(frame)
DCEI.SetTextFrameText(text_frame, "Text")
DCEI.SetFrameSize(text_frame, 200, 100)
DCEI.SetTextFrameOutlineColor(text_frame, {r = 0.5, g = 0.5, b = 0, a = 0.5})

void SetTextFrameOutlineWidth(InGameUILayoutComponent text, float width)

void SetTextFrameOutlineWidth(InGameUILayoutComponent text, float width)

Description


Sets the width for a text frame's text outline.

Parameters

Example Usage

local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameImageColor(frame, {r = 1, g = 1, b = 0, a = 0.5})

local text_frame = DCEI.CreateTextFrame(frame)
DCEI.SetTextFrameText(text_frame, "Text")
DCEI.SetFrameSize(text_frame, 200, 100)
DCEI.SetTextFrameFontSize(text_frame, 50)
DCEI.SetTextFrameOutlineWidth(text_frame, 0.5)

void SetTextFrameOutlineSoftness(InGameUILayoutComponent text, float softness)

void SetTextFrameOutlineSoftness(InGameUILayoutComponent text, float softness)

Description


Set the softness for a text frame's text outline.

Parameters

Example Usage

local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameImageColor(frame, {r = 1, g = 1, b = 0, a = 0.5})

local text_frame = DCEI.CreateTextFrame(frame)
DCEI.SetTextFrameText(text_frame, "Text")
DCEI.SetFrameSize(text_frame, 200, 100)
DCEI.SetTextFrameFontSize(text_frame, 50)
DCEI.SetTextFrameOutlineSoftness(text_frame, 0.5)

void SetTextFrameShadowWidth(InGameUILayoutComponent text, float width)

void SetTextFrameShadowWidth(InGameUILayoutComponent text, float width)

Description


Sets the width for a text frame's text shadow.

Parameters

Example Usage

local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameImageColor(frame, {r = 1, g = 1, b = 0, a = 0.5})

local text_frame = DCEI.CreateTextFrame(frame)
DCEI.SetTextFrameText(text_frame, "Text")
DCEI.SetFrameSize(text_frame, 200, 100)
DCEI.SetTextFrameFontSize(text_frame, 50)
DCEI.SetTextFrameShadowWidth(text_frame, 0.5)

void SetTextFrameShadowColor(InGameUILayoutComponent text, ColorRGBA color)

void SetTextFrameShadowColor(InGameUILayoutComponent text, ColorRGBA color)

Description

Parameters

Example Usage

local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameImageColor(frame, {r = 1, g = 1, b = 0, a = 0.5})

local text_frame = DCEI.CreateTextFrame(frame)
DCEI.SetTextFrameText(text_frame, "Text")
DCEI.SetFrameSize(text_frame, 200, 100)
DCEI.SetTextFrameFontSize(text_frame, 50)
DCEI.SetTextFrameShadowColor(text_frame, {r = 0.5, g = 0.5, b = 0, a = 0.5})

void SetTextFrameShadowSoftness(InGameUILayoutComponent text, float softness)

void SetTextFrameShadowSoftness(InGameUILayoutComponent text, float softness)

Description


Set the softness for a text frame's text shadow.

Parameters

Example Usage

local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameImageColor(frame, { r = 1, g = 1, b = 0, a = 0.5 })

local text_frame = DCEI.CreateTextFrame(frame)
DCEI.SetTextFrameText(text_frame, "Text")
DCEI.SetFrameSize(text_frame, 200, 100)
DCEI.SetTextFrameFontSize(text_frame, 50)
DCEI.SetTextFrameShadowSoftness(text_frame, 1)

string GetInputFrameText(InGameUILayoutComponent text)

string GetInputFrameText(InGameUILayoutComponent text)

Description


Returns the text entered into an input text frame.

Parameters

Example Usage

local input_frame = DCEI.CreateInputFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(input_frame, 100, 50)
DCEI.SetInputFrameText(input_frame, "Input Frame")

local input = DCEI.GetInputFrameText(input_frame)
DCEI.LogMessage(input)

void SetInputFrameText(InGameUILayoutComponent text, string content)

void SetInputFrameText(InGameUILayoutComponent text, string content)

Description


Sets the text for an input frame.

Parameters

Example Usage

local input_frame = DCEI.CreateInputFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(input_frame, 100, 50)
DCEI.SetInputFrameText(input_frame, "Input Frame")

void SetInputFrameFontSize(InGameUILayoutComponent text, float size)

void SetInputFrameFontSize(InGameUILayoutComponent text, float size)

Description


Sets the text size for an input frame.

Parameters

Example Usage

local input_frame = DCEI.CreateInputFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(input_frame, 100, 50)
DCEI.SetInputFrameText(input_frame, "Input Frame")
DCEI.SetInputFrameFontSize(input_frame, 50)

void SetInputFrameColor(InGameUILayoutComponent text, ColorRGB color)

void SetInputFrameColor(InGameUILayoutComponent text, ColorRGB color)

Description


Sets the text color for an input frame.

Parameters

Example Usage

local input_frame = DCEI.CreateInputFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(input_frame, 100, 50)
DCEI.SetInputFrameText(input_frame, "Input Frame")
DCEI.SetInputFrameColor(input_frame, {r = 0.5, g = 0.5, b = 0})

void SetInputFrameWrapping(InGameUILayoutComponent text, bool enable)

void SetInputFrameWrapping(InGameUILayoutComponent text, bool enable)

Description


Sets text wrapping for an input frame.

Parameters

Example Usage

local input_frame = DCEI.CreateInputFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(input_frame, 100, 50)
DCEI.SetInputFrameText(input_frame, "Input Frame Wrapping Test")
DCEI.SetInputFrameWrapping(input_frame, true)

void SetInputFramePlaceholder(InGameUILayoutComponent text, string content)

void SetInputFramePlaceholder(InGameUILayoutComponent text, string content)

Description


Sets the text placeholder for an input frame.

Parameters

Example Usage

local input_frame = DCEI.CreateInputFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(input_frame, 100, 50)
DCEI.SetInputFramePlaceholder(input_frame, "Edit me")

void SetInputFramePlaceholderFontSize(InGameUILayoutComponent text, float size)

void SetInputFramePlaceholderFontSize(InGameUILayoutComponent text, float size)

Description


Sets the placeholder text size for an input frame.

Parameters

Example Usage

local input_frame = DCEI.CreateInputFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(input_frame, 100, 50)
DCEI.SetInputFramePlaceholder(input_frame, "Input Placeholder")
DCEI.SetInputFramePlaceholderFontSize(input_frame, 50)

void SetInputFramePlaceholderColor(InGameUILayoutComponent text, ColorRGB color)

void SetInputFramePlaceholderColor(InGameUILayoutComponent text, ColorRGB color)

Description


Sets the text placeholder's color for an input frame.

Parameters

Example Usage

local input_frame = DCEI.CreateInputFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(input_frame, 100, 50)
DCEI.SetInputFramePlaceholder(input_frame, "Input Placeholder")
DCEI.SetInputFramePlaceholderColor(input_frame, {r = 0.5, g = 0.5, b = 0})

void SetInputFramePlaceholderOutline(InGameUILayoutComponent text, bool outline)

void SetInputFramePlaceholderOutline(InGameUILayoutComponent text, bool outline)

Description


Sets the text placeholder's outline for an input frame.

Parameters

Example Usage

local input_frame = DCEI.CreateInputFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(input_frame, 100, 50)
DCEI.SetInputFramePlaceholder(input_frame, "Input Placeholder")
DCEI.SetInputFramePlaceholderOutline(input_frame, true)

void SetUserInputTextFrameText(InGameUILayoutComponent text, string content)

void SetUserInputTextFrameText(InGameUILayoutComponent text, string content)

Description


Sets the text for a user input text frame.

Parameters

Example Usage

local vstack = DCEI.CreateVStackFrame(DCEI.GetUiRootFrame())
local input_frame = DCEI.CreateInputFrame(vstack)
DCEI.SetInputFrameText(input_frame, "Input Frame")
DCEI.SetFrameSize(input_frame, 300, 50)

local input = DCEI.GetInputFrameText(input_frame)

local user_input = DCEI.CreateUserInputTextFrame(vstack)
DCEI.SetFrameSize(user_input, 300, 50)
DCEI.SetFrameImageColor(user_input, {r = 1, g = 0, b = 1, a = 0.4})
DCEI.SetUserInputTextFrameText(user_input, input)

void SetUserInputTextFrameFontSize(InGameUILayoutComponent text, float size)

void SetUserInputTextFrameFontSize(InGameUILayoutComponent text, float size)

Description


Sets the text size for a user input text frame.

Parameters

Example Usage

local user_input = DCEI.CreateUserInputTextFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameImageColor(user_input, {r = 1, g = 0, b = 0, a = 0.5})
DCEI.SetFrameSize(user_input, 400, 100)
DCEI.SetUserInputTextFrameText(user_input, "User Input Text")
DCEI.SetUserInputTextFrameFontSize(user_input, 50)

void SetUserInputTextFrameColor(InGameUILayoutComponent text, ColorRGB color)

void SetUserInputTextFrameColor(InGameUILayoutComponent text, ColorRGB color)

Description


Sets the text color for a user input text frame.

Parameters

Example Usage

local user_input = DCEI.CreateUserInputTextFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameImageColor(user_input, {r = 1, g = 0, b = 0, a = 0.5})
DCEI.SetFrameSize(user_input, 400, 100)
DCEI.SetUserInputTextFrameText(user_input, "User Input Text")
DCEI.SetUserInputTextFrameFontSize(user_input, 50)
DCEI.SetUserInputTextFrameColor(user_input, {r = 0.5, g = 0.5, b = 0})

void SetUserInputTextFrameWrapping(InGameUILayoutComponent text, bool enable)

void SetUserInputTextFrameWrapping(InGameUILayoutComponent text, bool enable)

Description


Sets text wrapping for a user input text frame.

Parameters

Example Usage

local user_input = DCEI.CreateUserInputTextFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameImageColor(user_input, {r = 1, g = 0, b = 0, a = 0.5})
DCEI.SetFrameSize(user_input, 200, 100)
DCEI.SetUserInputTextFrameText(user_input, "User Input Text")
DCEI.SetUserInputTextFrameFontSize(user_input, 50)
DCEI.SetUserInputTextFrameWrapping(user_input, true)

void SetFrameMinSize(InGameUILayoutComponent ui, float width, float height)

void SetFrameMinSize(InGameUILayoutComponent ui, float width, float height)

Description


Sets the minimum size of a frame. The frame will still expand to fit its content if larger than this minimum size.

Parameters

Example Usage

local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameMinSize(frame, 100, 100)
DCEI.SetFrameImageColor(frame, {r = 0, g = 0, b = 1, a = 0.5})

void SetFrameMinWidth(InGameUILayoutComponent ui, float width)

void SetFrameMinWidth(InGameUILayoutComponent ui, float width)

Description


Sets the minimum width of a frame. The frame will still expand to fit its content if larger than this minimum width.

Parameters

Example Usage

local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameMinWidth(frame, 100)
DCEI.SetFrameImageColor(frame, {r = 0, g = 0, b = 1, a = 0.5})

void SetFrameMinHeight(InGameUILayoutComponent ui, float height)

void SetFrameMinHeight(InGameUILayoutComponent ui, float height)

Description


Sets the minimum height of a frame. The frame will still expand to fit its content if larger than this minimum height.

Parameters

Example Usage

local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameMinHeight(frame, 100)
DCEI.SetFrameImageColor(frame, {r = 0, g = 0, b = 1, a = 0.5})

void SetFrameMaxSize(InGameUILayoutComponent ui, float width, float height)

void SetFrameMaxSize(InGameUILayoutComponent ui, float width, float height)

Description


Sets the maximum size of a frame. The frame will still shrink to fit its content if smaller than this maximum size.

Can be used with CreateTextFrame to create dynamic text scaling (with SetTextFrameFontSizeMin/SetTextFrameFontSizeMax).

Parameters

Example Usage

local label = DCEI.CreateTextFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameMaxSize(label, 100, 48)

local text = "Some text we want to wrap."
DCEI.SetTextFrameText(label, text)

void SetFrameMaxWidth(InGameUILayoutComponent ui, float width)

void SetFrameMaxWidth(InGameUILayoutComponent ui, float width)

Description


Sets the maximum width of a frame. The frame will still expand to fit its content if larger than this maximum width.

Parameters

Example Usage

local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameMaxWidth(frame, 100)
DCEI.SetFrameImageColor(frame, {r = 0, g = 0, b = 1, a = 0.5})

void SetFrameMaxHeight(InGameUILayoutComponent ui, float height)

void SetFrameMaxHeight(InGameUILayoutComponent ui, float height)

Description


Sets the maximum height of a frame. The frame will still expand to fit its content if larger than this maximum height.

Parameters

Example Usage

local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameMaxHeight(frame, 100)
DCEI.SetFrameImageColor(frame, {r = 0, g = 0, b = 1, a = 0.5})

void SetFrameSize(InGameUILayoutComponent ui, float width, float height)

void SetFrameSize(InGameUILayoutComponent ui, float width, float height)

Description


Sets the absolute size of a frame that will not expand/shrink to accommodate its children.

Parameters

Example Usage

local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(frame, 100, 100)
DCEI.SetFrameImageColor(frame, {r = 0, g = 0, b = 1, a = 0.5})

InGameUILayoutComponent CreateListFrame(InGameUILayoutComponent parent)

InGameUILayoutComponent CreateListFrame(InGameUILayoutComponent parent)

Description


Create a virtualized list frame. Virtual lists greatly improve the performance of long lists by only creating UI elements when the user scrolls. Elements outside of the scroll view won't be created or updated, saving on performance.
See Using Virtual Lists for more information.

Parameters

Example Usage

local root = DCEI.GetUiRootFrame()
local v_list = DCEI.CreateListFrame(root)

void SetListFrameItemName(InGameUILayoutComponent ui, string itemName)

void SetListFrameItemName(InGameUILayoutComponent ui, string itemName)

Description


Set the XML name for virtualized list's item.
See Using Virtual Lists for more information.

Parameters

Example Usage

local root = DCEI.GetUiRootFrame()
local v_list = DCEI.CreateListFrame(root)
DCEI.SetListFrameItemName(v_list, "ListItem")

void SetListFrameItemSize(InGameUILayoutComponent ui, float itemSize)

void SetListFrameItemSize(InGameUILayoutComponent ui, float itemSize)

Description


Set the size for virtualized list's item.
See Using Virtual Lists for more information.

Parameters

Example Usage

local root = DCEI.GetUiRootFrame()
local v_list = DCEI.CreateListFrame(root)
DCEI.SetListFrameItemSize(v_list, 50)

void SetListFrameItemDataCallback(InGameUILayoutComponent ui, TypedCallback<InGameUILayoutComponent, int> itemDataCallback)

void SetListFrameItemDataCallback(InGameUILayoutComponent ui, TypedCallback<InGameUILayoutComponent, int> itemDataCallback)

Description


Tell the virtual list how to create new items as well as how to bind the data to each item.
See Using Virtual Lists for more information.

Parameters

Example Usage

-- Virtual list requires a separate data storage.
local virtual_items = {}
DCEI.SetListFrameItemCount(virtual_list, #virtual_items)
DCEI.SetListFrameItemDataCallback(virtual_list, function(item, index)
    local text = DCEI.GetChildFrameById(item, "text")
    DCEI.SetTextFrameTextExpression(text, "row " .. virtual_items[index + 1].value .. " = {target.Health.Current}")
    ShowItemAnimated(item)
end)

void SetListFrameItemCount(InGameUILayoutComponent ui, int itemCount)

void SetListFrameItemCount(InGameUILayoutComponent ui, int itemCount)

Description


Tell the virtual list we have more items and the list to manage item creation if needed.
See Using Virtual Lists for more information.

Parameters

Example Usage

-- Instead of creating items directly, we update the underlying data structure.
for i = 1, count do
    table.insert(virtual_items, {value = #virtual_items + 1})
end
DCEI.SetListFrameItemCount(virtual_list, #virtual_items)

void RefreshListFrameItems(InGameUILayoutComponent ui, int startIndex, int endIndex)

void RefreshListFrameItems(InGameUILayoutComponent ui, int startIndex, int endIndex)

Description


Refresh a range of list items when their underlying data has changed. The data callback registered with DCEI.SetListFrameItemDataCallback() will be called for each visible list item in the specified range to rebind data to UI.
See Using Virtual Lists for more information.

Parameters

Example Usage

DCEI.SetOnClickCallback(refresh_button, function()
    refresh_count = refresh_count + 1
    DCEI.RefreshListFrameItems(virtual_list, 1, #virtual_items)
end)

InGameUILayoutComponent CreateSpineFrame(InGameUILayoutComponent parent)

InGameUILayoutComponent CreateSpineFrame(InGameUILayoutComponent parent)

Description


Creates a frame for Spine animations. See Spine animations.

Parameters

Example Usage

local spine = DCEI.CreateSpineFrame(GMUI.ui.Root)
DCEI.SetSpineFrameAsset(spine, "texiao3")
local animations = DCEI.GetSpineFrameAnimations(spine)
for _, animation in ipairs(animations) do
    DCEI.LogMessage("Animation: " .. animation)
end
DCEI.PlaySpineFrameAnimation(spine, animations[1], true, 1)

void SetSpineFrameAsset(InGameUILayoutComponent ui, string name)

void SetSpineFrameAsset(InGameUILayoutComponent ui, string name)

Description


Sets the Spine frame to the Spine asset. The asset must be in your map or mod’s Assets\SpineAnimations folder. See Spine animations.

Parameters

Example Usage

local spine = DCEI.CreateSpineFrame(GMUI.ui.Root)
DCEI.SetSpineFrameAsset(spine, "texiao3")
local animations = DCEI.GetSpineFrameAnimations(spine)
for _, animation in ipairs(animations) do
    DCEI.LogMessage("Animation: " .. animation)
end
DCEI.PlaySpineFrameAnimation(spine, animations[1], true, 1)

object GetSpineFrameAnimations(InGameUILayoutComponent ui)

object GetSpineFrameAnimations(InGameUILayoutComponent ui)

Description


Gets a table of spine animations from the given spine frame. See Spine animations

Parameters

Example Usage

local spine = DCEI.CreateSpineFrame(GMUI.ui.Root)
DCEI.SetSpineFrameAsset(spine, "texiao3")
local animations = DCEI.GetSpineFrameAnimations(spine)
for _, animation in ipairs(animations) do
    DCEI.LogMessage("Animation: " .. animation)
end
DCEI.PlaySpineFrameAnimation(spine, animations[1], true, 1)

void PlaySpineFrameAnimation(InGameUILayoutComponent ui, string name, bool loop = False, int track = 0)

void PlaySpineFrameAnimation(InGameUILayoutComponent ui, string name, bool loop = False, int track = 0)

Description


See Spine animations

Parameters

Example Usage

local spine = DCEI.CreateSpineFrame(GMUI.ui.Root)
DCEI.SetSpineFrameAsset(spine, "texiao3")
local animations = DCEI.GetSpineFrameAnimations(spine)
for _, animation in ipairs(animations) do
    DCEI.LogMessage("Animation: " .. animation)
end
DCEI.PlaySpineFrameAnimation(spine, animations[1], true, 1)

void SetFrameWidth(InGameUILayoutComponent ui, float width)

void SetFrameWidth(InGameUILayoutComponent ui, float width)

Description


Sets the absolute width of a frame that will not expand/shrink to accommodate its children.

Parameters

Example Usage

local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameWidth(frame, 100)

void SetFrameHeight(InGameUILayoutComponent ui, float height)

void SetFrameHeight(InGameUILayoutComponent ui, float height)

Description


Sets the absolute height of a frame that will not expand/shrink to accommodate its children.

Parameters

Example Usage

local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameHeight(frame, 100)

void FlipFrameHorizontal(InGameUILayoutComponent ui, bool dontFlipChildrenFrames = True)

void FlipFrameHorizontal(InGameUILayoutComponent ui, bool dontFlipChildrenFrames = True)

Description

Parameters

Example Usage

void FlipFrameVertical(InGameUILayoutComponent ui, bool dontFlipChildrenFrames = True)

void FlipFrameVertical(InGameUILayoutComponent ui, bool dontFlipChildrenFrames = True)

Description

Parameters

Example Usage

void SetFrameMatchParent(InGameUILayoutComponent ui, bool matchWidth, bool matchHeight)

void SetFrameMatchParent(InGameUILayoutComponent ui, bool matchWidth, bool matchHeight)

Description


Sets the dimensions of a UI frame to match that of its parent.

Parameters

Example Usage

local fullscreen_mask = DCEI.CreateFrame(DCEI.GetUiRootFrame())

DCEI.SetFrameMatchParent(fullscreen_mask, true, true)
DCEI.SetFrameImageColor(fullscreen_mask, {r = 0, g = 0, b = 0, a = 0.5})

void SetFramePadding(InGameUILayoutComponent ui, float padding)

void SetFramePadding(InGameUILayoutComponent ui, float padding)

Description


Sets the padding for a UI frame.

Parameters

Example Usage

local frame1 = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameImageColor(frame1, {r = 1, g = 0, b = 1, a = 0.4})
DCEI.SetFramePadding(frame1, 20)

local frame2 = DCEI.CreateFrame(frame1)
DCEI.SetFrameSize(frame2, 100, 100)
DCEI.SetFrameImageColor(frame2, {r = 0, g = 1, b = 1, a = 0.4})

void SetFramePaddingLeft(InGameUILayoutComponent ui, float padding)

void SetFramePaddingLeft(InGameUILayoutComponent ui, float padding)

Description


Sets the left padding for a UI frame.

Parameters

Example Usage

local frame1 = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameImageColor(frame1, {r = 1, g = 0, b = 1, a = 0.4})
DCEI.SetFramePaddingLeft(frame, 20)

local frame2 = DCEI.CreateFrame(frame1)
DCEI.SetFrameSize(frame2, 100, 100)
DCEI.SetFrameImageColor(frame2, {r = 0, g = 1, b = 1, a = 0.4})

void SetFramePaddingRight(InGameUILayoutComponent ui, float padding)

void SetFramePaddingRight(InGameUILayoutComponent ui, float padding)

Description


Sets the right padding for a UI frame.

Parameters

Example Usage

local frame1 = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameImageColor(frame1, {r = 1, g = 0, b = 1, a = 0.4})
DCEI.SetFramePaddingRight(frame1, 20)

local frame2 = DCEI.CreateFrame(frame1)
DCEI.SetFrameSize(frame2, 100, 100)
DCEI.SetFrameImageColor(frame2, {r = 0, g = 1, b = 1, a = 0.4})

void SetFramePaddingTop(InGameUILayoutComponent ui, float padding)

void SetFramePaddingTop(InGameUILayoutComponent ui, float padding)

Description


Sets the top padding for a UI frame.

Parameters

Example Usage

local frame1 = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameImageColor(frame1, {r = 1, g = 0, b = 1, a = 0.4})
DCEI.SetFramePaddingTop(frame1, 20)

local frame2 = DCEI.CreateFrame(frame1)
DCEI.SetFrameSize(frame2, 100, 100)
DCEI.SetFrameImageColor(frame2, {r = 0, g = 1, b = 1, a = 0.4})

void SetFramePaddingBottom(InGameUILayoutComponent ui, float padding)

void SetFramePaddingBottom(InGameUILayoutComponent ui, float padding)

Description


Sets the bottom padding for a UI frame.

Parameters

Example Usage

local frame1 = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameImageColor(frame1, {r = 1, g = 0, b = 1, a = 0.4})
DCEI.SetFramePaddingBottom(frame1, 20)

local frame2 = DCEI.CreateFrame(frame1)
DCEI.SetFrameSize(frame2, 100, 100)
DCEI.SetFrameImageColor(frame2, {r = 0, g = 1, b = 1, a = 0.4})

void SetFrameSpacing(InGameUILayoutComponent ui, float spacing)

void SetFrameSpacing(InGameUILayoutComponent ui, float spacing)

Description


Sets the spacing between child elements for a UI frame. This function affects frames that automatically position their children, such as stacks or scrolls. For scrolls, this function should be called on the content frame returned by GetScrollFrameContent.

Parameters

Example Usage

local stack = DCEI.CreateVStackFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameImageColor(stack, {r = 0, g = 0, b = 0, a = 0.4})
DCEI.SetFrameSpacing(stack, 20)
DCEI.SetFramePadding(stack, 20)

local frame1 = DCEI.CreateFrame(stack)
DCEI.SetFrameSize(frame1, 100, 100)
DCEI.SetFrameImageColor(frame1, {r = 1, g = 0, b = 1, a = 0.4})

local frame2 = DCEI.CreateFrame(stack)
DCEI.SetFrameSize(frame2, 100, 100)
DCEI.SetFrameImageColor(frame2, {r = 0, g = 1, b = 1, a = 0.4})

void SetFrameLeftAlignment(InGameUILayoutComponent ui)

void SetFrameLeftAlignment(InGameUILayoutComponent ui)

Description


Sets left alignment for a UI frame's contents.

Parameters

Example Usage

local frame1 = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(frame1, 200, 200)
DCEI.SetFrameImageColor(frame1, {r = 1, g = 0, b = 1, a = 0.4})
DCEI.SetFrameLeftAlignment(frame1)

local frame2 = DCEI.CreateFrame(frame1)
DCEI.SetFrameSize(frame2, 100, 100)
DCEI.SetFrameImageColor(frame2, {r = 0, g = 1, b = 1, a = 0.4})

void SetFrameRightAlignment(InGameUILayoutComponent ui)

void SetFrameRightAlignment(InGameUILayoutComponent ui)

Description


Sets right alignment for a UI frame's contents.

Parameters

Example Usage

local frame1 = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(frame1, 200, 200)
DCEI.SetFrameImageColor(frame1, {r = 1, g = 0, b = 1, a = 0.4})
DCEI.SetFrameRightAlignment(frame1)

local frame2 = DCEI.CreateFrame(frame1)
DCEI.SetFrameSize(frame2, 100, 100)
DCEI.SetFrameImageColor(frame2, {r = 0, g = 1, b = 1, a = 0.4})

void SetFrameTopAlignment(InGameUILayoutComponent ui)

void SetFrameTopAlignment(InGameUILayoutComponent ui)

Description


Sets top alignment for a UI frame's contents.

Parameters

Example Usage

local frame1 = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(frame1, 200, 200)
DCEI.SetFrameImageColor(frame1, {r = 1, g = 0, b = 1, a = 0.4})
DCEI.SetFrameTopAlignment(frame1)

local frame2 = DCEI.CreateFrame(frame1)
DCEI.SetFrameSize(frame2, 100, 100)
DCEI.SetFrameImageColor(frame2, {r = 0, g = 1, b = 1, a = 0.4})

void SetFrameBottomAlignment(InGameUILayoutComponent ui)

void SetFrameBottomAlignment(InGameUILayoutComponent ui)

Description


Sets bottom alignment for a UI frame's contents.

Parameters

Example Usage

local frame1 = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(frame1, 200, 200)
DCEI.SetFrameImageColor(frame1, {r = 1, g = 0, b = 1, a = 0.4})
DCEI.SetFrameBottomAlignment(frame1)

local frame2 = DCEI.CreateFrame(frame1)
DCEI.SetFrameSize(frame2, 100, 100)
DCEI.SetFrameImageColor(frame2, {r = 0, g = 1, b = 1, a = 0.4})

void SetFrameCenterAlignment(InGameUILayoutComponent ui)

void SetFrameCenterAlignment(InGameUILayoutComponent ui)

Description


Sets center alignment for a UI frame's contents. This is the default alignment.

Parameters

Example Usage

local frame1 = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(frame1, 200, 200)
DCEI.SetFrameImageColor(frame1, {r = 1, g = 0, b = 1, a = 0.4})
DCEI.SetFrameBottomAlignment(frame1)

local frame2 = DCEI.CreateFrame(frame1)
DCEI.SetFrameSize(frame2, 100, 100)
DCEI.SetFrameImageColor(frame2, {r = 0, g = 1, b = 1, a = 0.4})

DCEI.TriggerAddTimerEventElapsed(
    function()
        DCEI.SetFrameCenterAlignment(frame1)
    end,
    1, true
)

void SetFrameLeftAlignmentInParent(InGameUILayoutComponent ui)

void SetFrameLeftAlignmentInParent(InGameUILayoutComponent ui)

Description


Aligns a frame to its parent's left edge.

Note that setting left/right alignment won't work for frames that have their horizontal alignment determined by another source (ex, the children frames of an HStack). This can be worked around by wrapping the frame you want to reposition inside a blank frame.

Parameters

Example Usage

local frame1 = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(frame1, 200, 200)
DCEI.SetFrameImageColor(frame1, {r = 1, g = 0, b = 1, a = 0.4})

local frame2 = DCEI.CreateFrame(frame1)
DCEI.SetFrameSize(frame2, 100, 100)
DCEI.SetFrameImageColor(frame2, {r = 0, g = 1, b = 1, a = 0.4})
DCEI.SetFrameLeftAlignmentInParent(frame2)

void SetFrameRightAlignmentInParent(InGameUILayoutComponent ui)

void SetFrameRightAlignmentInParent(InGameUILayoutComponent ui)

Description


Aligns a frame to its parent's right edge.

Note that setting left/right alignment won't work for frames that have their horizontal alignment determined by another source (ex, the children frames of a HStack). This can be worked around by wrapping the frame you want to reposition inside a blank frame.

Parameters

Example Usage

local frame1 = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(frame1, 200, 200)
DCEI.SetFrameImageColor(frame1, {r = 1, g = 0, b = 1, a = 0.4})

local frame2 = DCEI.CreateFrame(frame1)
DCEI.SetFrameSize(frame2, 100, 100)
DCEI.SetFrameImageColor(frame2, {r = 0, g = 1, b = 1, a = 0.4})
DCEI.SetFrameRightAlignmentInParent(frame2)

void SetFrameTopAlignmentInParent(InGameUILayoutComponent ui)

void SetFrameTopAlignmentInParent(InGameUILayoutComponent ui)

Description


Aligns a frame to its parent's top edge.

Note that setting top/bottom alignment won't work for frames that have their vertical alignment determined by another source (ex, the children frames of a VStack). This can be worked around by wrapping the frame you want to reposition inside a blank frame.

Parameters

Example Usage

local frame1 = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(frame1, 200, 200)
DCEI.SetFrameImageColor(frame1, {r = 1, g = 0, b = 1, a = 0.4})

local frame2 = DCEI.CreateFrame(frame1)
DCEI.SetFrameSize(frame2, 100, 100)
DCEI.SetFrameImageColor(frame2, {r = 0, g = 1, b = 1, a = 0.4})
DCEI.SetFrameTopAlignmentInParent(frame2)

void SetFrameBottomAlignmentInParent(InGameUILayoutComponent ui)

void SetFrameBottomAlignmentInParent(InGameUILayoutComponent ui)

Description


Aligns a frame to its parent's bottom edge.

Note that setting top/bottom alignment won't work for frames that have their vertical alignment determined by another source (ex, the children frames of a VStack). This can be worked around by wrapping the frame you want to reposition inside a blank frame.

Parameters

Example Usage

local frame1 = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(frame1, 200, 200)
DCEI.SetFrameImageColor(frame1, {r = 1, g = 0, b = 1, a = 0.4})

local frame2 = DCEI.CreateFrame(frame1)
DCEI.SetFrameSize(frame2, 100, 100)
DCEI.SetFrameImageColor(frame2, {r = 0, g = 1, b = 1, a = 0.4})
DCEI.SetFrameBottomAlignmentInParent(frame2)

void SetFrameCenterAlignmentInParent(InGameUILayoutComponent ui)

void SetFrameCenterAlignmentInParent(InGameUILayoutComponent ui)

Description


Aligns a frame to its parent's center. This is the default alignment.

Note that setting top/bottom alignment won't work for frames that have their alignment determined by another source (ex, the children frames of a VStack or HStack). This can be worked around by wrapping the frame you want to reposition inside a blank frame.

Parameters

Example Usage

local frame1 = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(frame1, 200, 200)
DCEI.SetFrameImageColor(frame1, {r = 1, g = 0, b = 1, a = 0.4})

local frame2 = DCEI.CreateFrame(frame1)
DCEI.SetFrameSize(frame2, 100, 100)
DCEI.SetFrameImageColor(frame2, {r = 0, g = 1, b = 1, a = 0.4})
DCEI.SetFrameBottomAlignmentInParent(frame2)

DCEI.TriggerAddTimerEventElapsed(
    function()
        DCEI.SetFrameCenterAlignmentInParent(frame2)
    end,
    1, true
)

void SetFrameHorizontalOffsetInParent(InGameUILayoutComponent ui, float value)

void SetFrameHorizontalOffsetInParent(InGameUILayoutComponent ui, float value)

Description


Offsets a frame horizontally from its starting position in its parent.

Note that setting an offset won't work for frames that have their alignment determined by another source (ex, the children frames of a VStack or HStack). This can be worked around by wrapping the frame you want to reposition inside a blank frame.

Parameters

Example Usage

local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(frame, 200, 200)
DCEI.SetFrameImageColor(frame, {r = 1, g = 0, b = 1, a = 0.4})
DCEI.SetFrameHorizontalOffsetInParent(frame, 200)

void SetFrameVerticalOffsetInParent(InGameUILayoutComponent ui, float value)

void SetFrameVerticalOffsetInParent(InGameUILayoutComponent ui, float value)

Description


Offsets a frame vertically from its starting position in its parent.

Note that setting an offset won't work for frames that have their alignment determined by another source (ex, the children frames of a VStack or HStack). This can be worked around by wrapping the frame you want to reposition inside a blank frame.

Parameters

Example Usage

local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(frame, 200, 200)
DCEI.SetFrameImageColor(frame, {r = 1, g = 0, b = 1, a = 0.4})
DCEI.SetFrameVerticalOffsetInParent(frame, 100)

void SetFrameReverseChildrenFrameOrder(InGameUILayoutComponent ui, bool value)

void SetFrameReverseChildrenFrameOrder(InGameUILayoutComponent ui, bool value)

Description


Reverses the order in which frames are added to a CreateHStackFrame, CreateVStackFrame, CreateHScrollFrame, or CreateVScrollFrame. This will affect newly added child frames as well as any child frames that have already been added.

Parameters

Example Usage

local stack = DCEI.CreateVStackFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameImageColor(stack, {r = 0, g = 0, b = 0, a = 0.4})
DCEI.SetFrameSpacing(stack, 20)
DCEI.SetFramePadding(stack, 20)

local frame1 = DCEI.CreateFrame(stack)
DCEI.SetFrameSize(frame1, 100, 100)
DCEI.SetFrameImageColor(frame1, {r = 1, g = 0, b = 1, a = 0.4})

local frame2 = DCEI.CreateFrame(stack)
DCEI.SetFrameSize(frame2, 100, 100)
DCEI.SetFrameImageColor(frame2, {r = 0, g = 1, b = 1, a = 0.4})

DCEI.TriggerAddTimerEventElapsed(
    function()
        DCEI.SetFrameReverseChildrenFrameOrder(stack, true)
    end,
    1, true
)

void SetFrameUsingFlexLayout(InGameUILayoutComponent ui)

void SetFrameUsingFlexLayout(InGameUILayoutComponent ui)

Description


Sets a custom UI frame to use flex layout.

Parameters

Example Usage

local input_text = DCEI.CreateUserInputTextFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(input_text, 200, 50)
DCEI.SetUserInputTextFrameText(input_text, "pretend I'm user input text")
-- Set the newly created user input text frame to use flex layout.
DCEI.SetFrameUsingFlexLayout(input_text)

bool IsFrameUsingFlexLayout(InGameUILayoutComponent ui)

bool IsFrameUsingFlexLayout(InGameUILayoutComponent ui)

Description


Check if a given frame is using Flex layouts. For the difference between Flex and Legacy layouts, see this notion guide.

Parameters

Example Usage

local function IsFrameFlex()
    local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
    local is_flex = DCEI.IsFrameUsingFlexLayout(frame)
    -- As of March 2023, "is_flex" would be false as frames default to legacy rather than flex.
end

void SetFrameFlexDirection(InGameUILayoutComponent ui, YogaFlexDirection direction)

void SetFrameFlexDirection(InGameUILayoutComponent ui, YogaFlexDirection direction)

Description


Sets the frames Flex Direction. Flex direction controls the direction in which children of a node are laid out.

For more info (including visualizations of each property) see flexDirection XML attribute.

Parameters

Example Usage


XML "FlexLayout":

<Frame layout="flex">
    <Frame frameImageColor="#ff0000ff" width="50" height="50" />
    <Frame frameImageColor="#00ff00ff" width="50" height="50" />
</Frame>

Lua:

local GMUI = require("GMUI")

local function TestFlexProperty()
    local NewFlexLayout = GMUI.Layout.New({ name = "FlexLayout" })
    DCEI.SetFrameFlexDirection(NewFlexLayout.Frame, "column")
end

TestFlexProperty()

void SetFrameFlexGrow(InGameUILayoutComponent ui, float grow)

void SetFrameFlexGrow(InGameUILayoutComponent ui, float grow)

Description


flexGrow describes how any space within a container should be distributed among its children along the main axis. After laying out its children, a container will distribute any remaining space according to the flexGrow values specified by its children.

For more info (including visualizations of each property) see flexGrow XML attribute.

Parameters

Example Usage


XML "FlexLayout":

<Frame layout="flex" width="600">
    <Frame id="child1" frameImageColor="#ff0000ff" minWidth="50" height="50" />
    <Frame id="child2" frameImageColor="#00ff00ff" minWidth="50" height="50" />
</Frame>

Lua:

local GMUI = require("GMUI")

local function TestFlexProperty()
    local NewFlexLayout = GMUI.Layout.New({ name = "FlexLayout" })
    DCEI.SetFrameFlexGrow(NewFlexLayout.child1, 0.5)
    DCEI.SetFrameFlexGrow(NewFlexLayout.child2, 1)
end

TestFlexProperty()

void SetFrameFlexShrink(InGameUILayoutComponent ui, float shrink)

void SetFrameFlexShrink(InGameUILayoutComponent ui, float shrink)

Description


flexShrink is very similar to flexGrow and can be thought of in the same way if any overflowing size is considered to be negative remaining space.

For more info (including visualizations of each property) see flexShrink XML attribute.

Parameters

Example Usage


XML "FlexLayout":

<Frame layout="flex" width="200">
    <Frame id="child1" frameImageColor="#ff0000ff" widthPercent="100" height="50" />
    <Frame id="child2" frameImageColor="#00ff00ff" widthPercent="100" height="50" />
</Frame>

Lua:

local GMUI = require("GMUI")

local function TestFlexProperty()
    local NewFlexLayout = GMUI.Layout.New({ name = "FlexLayout" })
    DCEI.SetFrameFlexShrink(NewFlexLayout.child1, 0.3)
    DCEI.SetFrameFlexShrink(NewFlexLayout.child2, 0.6)
end

TestFlexProperty()

void SetFrameFlexWrap(InGameUILayoutComponent ui, YogaWrap wrap)

void SetFrameFlexWrap(InGameUILayoutComponent ui, YogaWrap wrap)

Description


By default, flex items will all try to fit onto one line. You can change that and allow the items to wrap as needed with this property.

For more info (including visualizations of each property) see flexWrap XML attribute.

Parameters

Example Usage


XML "FlexLayout":

<Frame layout="flex" width="200" >
    <Frame id="child1" frameImageColor="#ff0000ff" widthPercent="100" height="50" />
    <Frame id="child2" frameImageColor="#00ff00ff" widthPercent="100" height="50" />
</Frame>

Lua:

local GMUI = require("GMUI")

local function TestFlexProperty()
    local NewFlexLayout = GMUI.Layout.New({ name = "FlexLayout" })
    DCEI.SetFrameFlexWrap(NewFlexLayout.Frame, "wrap")
end

TestFlexProperty()

void SetFrameJustifyContent(InGameUILayoutComponent ui, YogaJustify justifyContent)

void SetFrameJustifyContent(InGameUILayoutComponent ui, YogaJustify justifyContent)

Description


This defines the alignment along the main axis. For more info (including visualizations of each property) see justifyContent XML attribute.

Parameters

Example Usage


XML "FlexLayout":

<Frame layout="flex" width="200">
    <Frame id="child1" frameImageColor="#ff0000ff" width="50" height="50" />
    <Frame id="child2" frameImageColor="#00ff00ff" width="50" height="50" />
</Frame>

Lua:

local GMUI = require("GMUI")

local function TestFlexProperty()
    local NewFlexLayout = GMUI.Layout.New({ name = "FlexLayout" })
    DCEI.SetFrameJustifyContent(NewFlexLayout.Frame, "SpaceBetween")
end

TestFlexProperty()

void SetFrameAlignItems(InGameUILayoutComponent ui, YogaAlign alignItems)

void SetFrameAlignItems(InGameUILayoutComponent ui, YogaAlign alignItems)

Description


This defines the default behavior for how flex items are laid out along the cross axis on the current line. Think of it as the justify-content version for the cross-axis (perpendicular to the main-axis).

For more info (including visualizations of each property) see alignItems XML attribute.

Parameters

Example Usage


XML "FlexLayout":

<Frame layout="flex" width="200">
    <Frame id="child1" frameImageColor="#ff0000ff" width="50" height="150" />
    <Frame id="child2" frameImageColor="#00ff00ff" width="50" height="50" />
</Frame>

Lua:

local GMUI = require("GMUI")

local function TestFlexProperty()
    local NewFlexLayout = GMUI.Layout.New({ name = "FlexLayout" })
    DCEI.SetFrameAlignItems(NewFlexLayout.Frame, "center")
end

TestFlexProperty()

void SetFrameAlignContent(InGameUILayoutComponent ui, YogaAlign alignContent)

void SetFrameAlignContent(InGameUILayoutComponent ui, YogaAlign alignContent)

Description


This aligns a flex container’s lines within when there is extra space in the cross-axis, similar to how justify-content aligns individual items within the main-axis.

Note: This property only takes effect on multi-line flexible containers, where flex-wrap is set to either wrap or wrap-reverse). A single-line flexible container (i.e. where flex-wrap is set to its default value, no-wrap) will not reflect align-content.

For more info (including visualizations of each property) see alignContent XML attribute.

Parameters

Example Usage


XML "FlexLayout":

<Frame layout="flex" width="200" height="200" flexWrap="wrap" frameImageColor="#000000ff">
    <Frame id="child1" frameImageColor="#ff0000ff" widthPercent="25" heightPercent="25"/>
    <Frame id="child2" frameImageColor="#00ff00ff" widthPercent="25" heightPercent="25"/>
    <Frame id="child3" frameImageColor="#ff0000ff" widthPercent="25" heightPercent="25"/>
    <Frame id="child4" frameImageColor="#00ff00ff" widthPercent="25" heightPercent="25"/>
    <Frame id="child5" frameImageColor="#ff0000ff" widthPercent="25" heightPercent="25"/>
    <Frame id="child6" frameImageColor="#00ff00ff" widthPercent="25" heightPercent="25"/>
</Frame>

Lua:

local GMUI = require("GMUI")

local function TestFlexProperty()
    local NewFlexLayout = GMUI.Layout.New({ name = "FlexLayout" })
    DCEI.SetFrameAlignContent(NewFlexLayout.Frame, "flex-end")
end

TestFlexProperty()

void SetFrameAlignSelf(InGameUILayoutComponent ui, YogaAlign alignSelf)

void SetFrameAlignSelf(InGameUILayoutComponent ui, YogaAlign alignSelf)

Description


This allows the default alignment (or the one specified by align-items) to be overridden for individual flex items.

For more info (including visualizations of each property) see alignSelf XML attribute.

Parameters

Example Usage

<Frame layout="flex" width="200" height="200" flexWrap="wrap" alignItems="stretch" frameImageColor="#000000ff">
    <Frame id="child1" frameImageColor="#ff0000ff" widthPercent="25" heightPercent="25" />
    <Frame id="child2" frameImageColor="#00ff00ff" widthPercent="25" heightPercent="25" />
    <Frame id="child3" frameImageColor="#ff0000ff" widthPercent="25" heightPercent="25" />
    <Frame id="child4" frameImageColor="#00ff00ff" widthPercent="25" heightPercent="25" />
    <Frame id="child5" frameImageColor="#ff0000ff" widthPercent="25" heightPercent="25" />
    <Frame id="child6" frameImageColor="#00ff00ff" widthPercent="25" heightPercent="25" />
</Frame>

Lua:

local GMUI = require("GMUI")

local function TestFlexProperty()
    local NewFlexLayout = GMUI.Layout.New({ name = "FlexLayout" })
    DCEI.SetFrameAlignSelf(NewFlexLayout.child6, "flex-end")
end

TestFlexProperty()

void SetFrameMarginLeft(InGameUILayoutComponent ui, float marginLeft)

void SetFrameMarginLeft(InGameUILayoutComponent ui, float marginLeft)

Description


Margin effects the spacing around the outside of a node. A node with margin will offset itself from the bounds of its parent but also offset the location of any siblings. The margin of a node contributes to the total size of its parent if the parent is auto sized.

For more info (including visualizations of each property) see margin XML attributes.

Parameters

Example Usage

<Frame layout="flex" width="200" height="200" flexWrap="wrap">
    <Frame id="child1" frameImageColor="#ff0000ff" width="55" height="55" />
    <Frame id="child2" frameImageColor="#00ff00ff" width="55" height="55" />
    <Frame id="child3" frameImageColor="#0000ffff" width="55" height="55" />
    <Frame id="child4" frameImageColor="#ff0000ff" width="55" height="55" />
    <Frame id="child5" frameImageColor="#00ff00ff" width="55" height="55" />
    <Frame id="child6" frameImageColor="#0000ffff" width="55" height="55" />
    <Frame id="child7" frameImageColor="#ff0000ff" width="55" height="55" />
    <Frame id="child8" frameImageColor="#00ff00ff" width="55" height="55" />
    <Frame id="child9" frameImageColor="#0000ffff" width="55" height="55" />
</Frame>

Lua:

local GMUI = require("GMUI")

local function TestFlexProperty()
    local NewFlexLayout = GMUI.Layout.New({ name = "FlexLayout" })
    DCEI.SetFrameMarginBottom(NewFlexLayout.child5, 5)
end

TestFlexProperty()

void SetFrameMarginRight(InGameUILayoutComponent ui, float marginRight)

void SetFrameMarginRight(InGameUILayoutComponent ui, float marginRight)

Description


Margin effects the spacing around the outside of a node. A node with margin will offset itself from the bounds of its parent but also offset the location of any siblings. The margin of a node contributes to the total size of its parent if the parent is auto sized.

For more info (including visualizations of each property) see margin XML attributes.

Parameters

Example Usage

<Frame layout="flex" width="200" height="200" flexWrap="wrap">
    <Frame id="child1" frameImageColor="#ff0000ff" width="55" height="55" />
    <Frame id="child2" frameImageColor="#00ff00ff" width="55" height="55" />
    <Frame id="child3" frameImageColor="#0000ffff" width="55" height="55" />
    <Frame id="child4" frameImageColor="#ff0000ff" width="55" height="55" />
    <Frame id="child5" frameImageColor="#00ff00ff" width="55" height="55" />
    <Frame id="child6" frameImageColor="#0000ffff" width="55" height="55" />
    <Frame id="child7" frameImageColor="#ff0000ff" width="55" height="55" />
    <Frame id="child8" frameImageColor="#00ff00ff" width="55" height="55" />
    <Frame id="child9" frameImageColor="#0000ffff" width="55" height="55" />
</Frame>

Lua:

local GMUI = require("GMUI")

local function TestFlexProperty()
    local NewFlexLayout = GMUI.Layout.New({ name = "FlexLayout" })
    DCEI.SetFrameMarginRight(NewFlexLayout.child5, 5)
end

TestFlexProperty()

void SetFrameMarginTop(InGameUILayoutComponent ui, float marginTop)

void SetFrameMarginTop(InGameUILayoutComponent ui, float marginTop)

Description


Margin effects the spacing around the outside of a node. A node with margin will offset itself from the bounds of its parent but also offset the location of any siblings. The margin of a node contributes to the total size of its parent if the parent is auto sized.

For more info (including visualizations of each property) see margin XML attributes.

Parameters

Example Usage

<Frame layout="flex" width="200" height="200" flexWrap="wrap">
    <Frame id="child1" frameImageColor="#ff0000ff" width="55" height="55" />
    <Frame id="child2" frameImageColor="#00ff00ff" width="55" height="55" />
    <Frame id="child3" frameImageColor="#0000ffff" width="55" height="55" />
    <Frame id="child4" frameImageColor="#ff0000ff" width="55" height="55" />
    <Frame id="child5" frameImageColor="#00ff00ff" width="55" height="55" />
    <Frame id="child6" frameImageColor="#0000ffff" width="55" height="55" />
    <Frame id="child7" frameImageColor="#ff0000ff" width="55" height="55" />
    <Frame id="child8" frameImageColor="#00ff00ff" width="55" height="55" />
    <Frame id="child9" frameImageColor="#0000ffff" width="55" height="55" />
</Frame>

Lua:

local GMUI = require("GMUI")

local function TestFlexProperty()
    local NewFlexLayout = GMUI.Layout.New({ name = "FlexLayout" })
    DCEI.SetFrameMarginTop(NewFlexLayout.child5, 5)
end

TestFlexProperty()

void SetFrameMarginBottom(InGameUILayoutComponent ui, float marginBottom)

void SetFrameMarginBottom(InGameUILayoutComponent ui, float marginBottom)

Description


Margin effects the spacing around the outside of a node. A node with margin will offset itself from the bounds of its parent but also offset the location of any siblings. The margin of a node contributes to the total size of its parent if the parent is auto sized.

For more info (including visualizations of each property) see margin XML attributes.

Parameters

Example Usage

<Frame layout="flex" width="200" height="200" flexWrap="wrap">
    <Frame id="child1" frameImageColor="#ff0000ff" width="55" height="55" />
    <Frame id="child2" frameImageColor="#00ff00ff" width="55" height="55" />
    <Frame id="child3" frameImageColor="#0000ffff" width="55" height="55" />
    <Frame id="child4" frameImageColor="#ff0000ff" width="55" height="55" />
    <Frame id="child5" frameImageColor="#00ff00ff" width="55" height="55" />
    <Frame id="child6" frameImageColor="#0000ffff" width="55" height="55" />
    <Frame id="child7" frameImageColor="#ff0000ff" width="55" height="55" />
    <Frame id="child8" frameImageColor="#00ff00ff" width="55" height="55" />
    <Frame id="child9" frameImageColor="#0000ffff" width="55" height="55" />
</Frame>

Lua:

local GMUI = require("GMUI")

local function TestFlexProperty()
    local NewFlexLayout = GMUI.Layout.New({ name = "FlexLayout" })
    DCEI.SetFrameMarginBottom(NewFlexLayout.child5, 5)
end

TestFlexProperty()

void SetFrameWidthPercent(InGameUILayoutComponent ui, float widthPercent)

void SetFrameWidthPercent(InGameUILayoutComponent ui, float widthPercent)

Description


This defines a frame's width as a percentage of it's parent's width. For more info see widthPercent XML attributes.

Parameters

Example Usage

<Frame layout="flex" width="200" height="200" flexWrap="wrap">
    <Frame id="child1" frameImageColor="#ff0000ff" widthPercent="50" height="55" />
    <Frame id="child2" frameImageColor="#00ff00ff" widthPercent="50" height="55" />
</Frame>

Lua:

local GMUI = require("GMUI")

local function TestFlexProperty()
    local NewFlexLayout = GMUI.Layout.New({ name = "FlexLayout" })
    DCEI.SetFrameWidthPercent(NewFlexLayout.child1, 30)
    DCEI.SetFrameWidthPercent(NewFlexLayout.child2, 60)
end

TestFlexProperty()

void SetFrameHeightPercent(InGameUILayoutComponent ui, float heightPercent)

void SetFrameHeightPercent(InGameUILayoutComponent ui, float heightPercent)

Description


This defines a frame's height as a percentage of it's parent's height. For more info see heightPercent XML attributes.

Parameters

Example Usage

<Frame layout="flex" width="200" height="200" flexWrap="wrap">
    <Frame id="child1" frameImageColor="#ff0000ff" width="50" heightPercent="50" />
    <Frame id="child2" frameImageColor="#00ff00ff" width="50" heightPercent="50" />
</Frame>

Lua:

local GMUI = require("GMUI")

local function TestFlexProperty()
    local NewFlexLayout = GMUI.Layout.New({ name = "FlexLayout" })
    DCEI.SetFrameHeightPercent(NewFlexLayout.child1, 30)
    DCEI.SetFrameHeightPercent(NewFlexLayout.child2, 60)
end

TestFlexProperty()

void SetFramePosition(InGameUILayoutComponent ui, YogaPositionType position)

void SetFramePosition(InGameUILayoutComponent ui, YogaPositionType position)

Description


Position Relative or Absolute.

Relative By default an element is positioned relatively. This means an element is positioned according to the normal flow of the layout, and then offset relative to that position based on the values of top, right, bottom, and left. The offset does not affect the position of any sibling or parent elements.

Absolute When positioned absolutely an element doesn't take part in the normal layout flow. It is instead laid out independent of its siblings. The position is determined based on the top, right, bottom, and left values.

For more info see position XML attribute.

Parameters

Example Usage

<Frame layout="flex" width="200" height="200" flexWrap="wrap">
    <Frame id="child1" frameImageColor="#ff0000ff" widthPercent="50" height="55" />
    <Frame id="child2" frameImageColor="#00ff00ff" widthPercent="50" height="55" />
</Frame>

Lua:

local GMUI = require("GMUI")

local function TestFlexProperty()
    local NewFlexLayout = GMUI.Layout.New({ name = "FlexLayout" })
    DCEI.SetFramePosition(NewFlexLayout.child1, "Absolute")
    DCEI.SetFrameLeft(NewFlexLayout.child1, 150)
end

TestFlexProperty()

void SetFrameLeft(InGameUILayoutComponent ui, float left)

void SetFrameLeft(InGameUILayoutComponent ui, float left)

Description


Offset position left, relative to the frames normal position if the position type is relative. If position type is absolute, this is the offset from the center of the parent frame rather than from this frames normal position in the flow of the frame.

For more info see position XML attribute.

Parameters

Example Usage

<Frame layout="flex" width="200" height="200" flexWrap="wrap">
    <Frame id="child1" frameImageColor="#ff0000ff" widthPercent="50" height="55" />
    <Frame id="child2" frameImageColor="#00ff00ff" widthPercent="50" height="55" />
</Frame>

Lua:

local GMUI = require("GMUI")

local function TestFlexProperty()
    local NewFlexLayout = GMUI.Layout.New({ name = "FlexLayout" })
    DCEI.SetFramePosition(NewFlexLayout.child1, "Absolute")
    DCEI.SetFrameLeft(NewFlexLayout.child1, 150)
end

TestFlexProperty()

void SetFrameRight(InGameUILayoutComponent ui, float right)

void SetFrameRight(InGameUILayoutComponent ui, float right)

Description


Offset position right, relative to the frames normal position if the position type is relative. If position type is absolute, this is the offset from the center of the parent frame rather than from this frames normal position in the flow of the frame.

For more info see position XML attribute.

Parameters

Example Usage

<Frame layout="flex" width="200" height="200" flexWrap="wrap">
    <Frame id="child1" frameImageColor="#ff0000ff" widthPercent="50" height="55" />
    <Frame id="child2" frameImageColor="#00ff00ff" widthPercent="50" height="55" />
</Frame>

Lua:

local GMUI = require("GMUI")

local function TestFlexProperty()
    local NewFlexLayout = GMUI.Layout.New({ name = "FlexLayout" })
    DCEI.SetFramePosition(NewFlexLayout.child1, "Absolute")
    DCEI.SetFrameRight(NewFlexLayout.child1, 150)
end

TestFlexProperty()

void SetFrameTop(InGameUILayoutComponent ui, float top)

void SetFrameTop(InGameUILayoutComponent ui, float top)

Description


Offset position top, relative to the frames normal position if the position type is relative. If position type is absolute, this is the offset from the center of the parent frame rather than from this frames normal position in the flow of the frame.

For more info see position XML attribute.

Parameters

Example Usage

<Frame layout="flex" width="200" height="200" flexWrap="wrap">
    <Frame id="child1" frameImageColor="#ff0000ff" widthPercent="50" height="55" />
    <Frame id="child2" frameImageColor="#00ff00ff" widthPercent="50" height="55" />
</Frame>

Lua:

local GMUI = require("GMUI")

local function TestFlexProperty()
    local NewFlexLayout = GMUI.Layout.New({ name = "FlexLayout" })
    DCEI.SetFramePosition(NewFlexLayout.child1, "Absolute")
    DCEI.SetFrameTop(NewFlexLayout.child1, 150)
end

TestFlexProperty()

void SetFrameBottom(InGameUILayoutComponent ui, float bottom)

void SetFrameBottom(InGameUILayoutComponent ui, float bottom)

Description


Offset position bottom, relative to the frames normal position if the position type is relative. If position type is absolute, this is the offset from the center of the parent frame rather than from this frames normal position in the flow of the frame.

For more info see position XML attribute.

Parameters

Example Usage

local GMUI = require("GMUI")

local function TestFlexProperty()
    local NewFlexLayout = GMUI.Layout.New({ name = "FlexLayout" })
    DCEI.SetFramePosition(NewFlexLayout.child1, "Absolute")
    DCEI.SetFrameBottom(NewFlexLayout.child1, 150)
end

TestFlexProperty()

void SetFrameAspectRatio(InGameUILayoutComponent ui, float aspectRatio)

void SetFrameAspectRatio(InGameUILayoutComponent ui, float aspectRatio)

Description


Set a Flex frame's aspect ratio.

For more info see aspectRatio XML attribute.

Parameters

Example Usage

local GMUI = require("GMUI")

local function TestFlexProperty()
    local NewFlexLayout = GMUI.Layout.New({ name = "FlexLayout" })
    DCEI.SetFrameAspectRatio(NewFlexLayout.child1, 0.5)
end

TestFlexProperty()

void SetFrameImage(InGameUILayoutComponent ui, string name)

void SetFrameImage(InGameUILayoutComponent ui, string name)

Description


Sets the background image of a UI frame.

Parameters

Example Usage

local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(frame, 100, 100)
DCEI.SetFrameImage(frame, DCEI.Texture("airship_onMap"))

void SetFrameImageExpression(InGameUILayoutComponent ui, string expression)

void SetFrameImageExpression(InGameUILayoutComponent ui, string expression)

Description


Sets the background image of a frame to the given expression. Expressions use data bound by BindLuaTable or BindUnitData.

Parameters

Example Usage

local vstack = DCEI.CreateVStackFrame(DCEI.GetUiRootFrame())

local data_frame = DCEI.CreateFrame(vstack)
DCEI.SetFrameSize(data_frame, 100, 100)

local data = {image = DCEI.Texture("airship_onMap")}
DCEI.BindLuaTable("data", data)
DCEI.SetFrameImageExpression(data_frame, "data.image")

local unit_frame = DCEI.CreateFrame(vstack)
DCEI.SetFrameSize(unit_frame, 100, 100)

local unit = DCEI.CreateUnit(1, 1, DCEI.Unit("Standard MeleeUnit"), 16, 16, 0, -1)
DCEI.BindUnitData("selected", unit)

-- this will display the icon of the bound unit, however none of the default units have icons
DCEI.SetFrameImageExpression(unit_frame, "selected.Info.Icon")

void SetFrameImageGrayScaleExpression(InGameUILayoutComponent ui, string expression)

void SetFrameImageGrayScaleExpression(InGameUILayoutComponent ui, string expression)

Description


Sets the background image of a frame to the given expression in gray scale. Expressions use data bound by BindLuaTable or BindUnitData.

Parameters

Example Usage

local vstack = DCEI.CreateVStackFrame(DCEI.GetUiRootFrame())

local data_frame = DCEI.CreateFrame(vstack)
DCEI.SetFrameSize(data_frame, 100, 100)

local data = {image = DCEI.Texture("airship_onMap"), gray = 1}
DCEI.BindLuaTable("data", data)
DCEI.SetFrameImageExpression(data_frame, "data.image")
DCEI.SetFrameImageGrayScaleExpression(data_frame, "data.gray")

local unit_frame = DCEI.CreateFrame(vstack)
DCEI.SetFrameSize(unit_frame, 100, 100)

local unit = DCEI.CreateUnit(1, 1, DCEI.Unit("Standard MeleeUnit"), 16, 16, 0, -1)
DCEI.BindUnitData("selected", unit)

-- this will display the icon of the bound unit, however none of the default units have icons
DCEI.SetFrameImageExpression(unit_frame, "selected.Info.Icon")

-- background image will be grayed out while the unit's health is >0
DCEI.SetFrameImageGrayScaleExpression(unit_frame, "selected.Health.Fraction")

void SetButtonDefaultClickAnimationEnabled(InGameUILayoutComponent ui, bool enable)

void SetButtonDefaultClickAnimationEnabled(InGameUILayoutComponent ui, bool enable)

Description


Enable or disable a Button frame's default click animation. This is the animation that makes buttons bounce a little when click/tapped.

Parameters

Example Usage

local function ButtonAnimationDisable()
    local root = DCEI.GetUiRootFrame()
    local new_button = DCEI.CreateButtonFrame(root)

    DCEI.SetButtonDefaultClickAnimationEnabled(new_button, false)
end

bool GetButtonDefaultClickAnimationEnabled(InGameUILayoutComponent ui)

bool GetButtonDefaultClickAnimationEnabled(InGameUILayoutComponent ui)

Description


Get current state (enabled or disabled) of a Button frame's default click animation. This is the animation that makes buttons bounce a little when click/tapped.

Parameters

Example Usage

local function ButtonAnimationDisable()
    local root = DCEI.GetUiRootFrame()
    local new_button = DCEI.CreateButtonFrame(root)

    DCEI.SetButtonDefaultClickAnimationEnabled(new_button, false)

    -- Will be false
    local button_state = DCEI.GetButtonDefaultClickAnimationEnabled(new_button)
end

void SetButtonFrameEnableExpression(InGameUILayoutComponent ui, string expression)

void SetButtonFrameEnableExpression(InGameUILayoutComponent ui, string expression)

Description


Sets an expression to enable a button. Expressions use data bound by BindLuaTable or BindUnitData.

Parameters

Example Usage

local vstack = DCEI.CreateVStackFrame(DCEI.GetUiRootFrame())

local data_button = DCEI.CreateButtonFrame(vstack)
DCEI.SetFrameSize(data_button, 100, 100)

local btn_data = {enable = 0}
DCEI.BindLuaTable("data", btn_data)
DCEI.SetButtonFrameEnableExpression(data_button, "data.enable")

local unit_button = DCEI.CreateButtonFrame(vstack)
DCEI.SetFrameSize(unit_button, 100, 100)

local unit = DCEI.CreateUnit(1, 1, DCEI.Unit("Standard MeleeUnit 2"), 16, 16, 0, -1)
DCEI.BindUnitData("selected", unit)

-- button will be disabled when the unit is dead
DCEI.SetButtonFrameEnableExpression(unit_button, "selected.Health.Fraction")

SetFrameImageTiled()

void SetFrameImageTiled(Transform ui, bool setTiled)

Description


Sets the tiling of the background image for a UI frame. If tiling is disabled, the image is stretched to fill the frame. You can adjust the tiling resolution with SetFramePixelsPerUnitMultiplier.

Parameters

Example Usage

local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(frame, 400, 400)
DCEI.SetFrameImage(frame, DCEI.Texture("airship_onMap"))
DCEI.SetFrameImageTiled(frame, true)


void SetFrameImageTiled(InGameUILayoutComponent ui, bool setTiled)

void SetFrameImageTiled(InGameUILayoutComponent ui, bool setTiled)

Description


Sets the tiling of the background image for a UI frame. If tiling is disabled, the image is stretched to fill the frame. You can adjust the tiling resolution with SetFramePixelsPerUnitMultiplier.

Parameters

Example Usage

local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(frame, 400, 400)
DCEI.SetFrameImage(frame, DCEI.Texture("airship_onMap"))
DCEI.SetFrameImageTiled(frame, true)

void SetFramePixelsPerUnitMultiplier(InGameUILayoutComponent ui, float pixelsPerUnitMultiplier)

void SetFramePixelsPerUnitMultiplier(InGameUILayoutComponent ui, float pixelsPerUnitMultiplier)

Description


Sets the pixels per unit multiplier for a UI frame. This multiplier is the ratio between screen units and image pixels. This can be used to adjust the tiling resolution of frames using SetFrameImageTiled and the edge/corner resolution of nineslice textures.

Parameters

Example Usage

-- This would reduce the frame's background image's size to 1/5.
local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameImage(frame, DCEI.Texture("airship_onMap"))
DCEI.SetFrameSize(frame, 500, 500)
DCEI.SetFramePixelsPerUnitMultiplier(frame, 5)

void SetFrameImageFillAmount(InGameUILayoutComponent ui, float fill)

void SetFrameImageFillAmount(InGameUILayoutComponent ui, float fill)

Description


Sets the fill amount for the background image.

Parameters

Example Usage

local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(frame, 100, 100)
DCEI.SetFrameImage(frame, DCEI.Texture("airship_onMap"))
DCEI.SetFrameImageFillAmount(frame, 0.5)

float GetFrameImageFillAmount(InGameUILayoutComponent ui)

float GetFrameImageFillAmount(InGameUILayoutComponent ui)

Description


Returns the background image fill amount.

Parameters

Example Usage

local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(frame, 100, 100)
DCEI.SetFrameImage(frame, DCEI.Texture("airship_onMap"))
DCEI.SetFrameImageFillAmount(frame, 0.5)

local fill = DCEI.GetFrameImageFillAmount(frame)
DCEI.LogMessage("Frame background image fill amount: " .. fill)

void SetFrameImageFillHorizontal(InGameUILayoutComponent ui)

void SetFrameImageFillHorizontal(InGameUILayoutComponent ui)

Description


Sets the background image fill for a frame to be horizontal. This is the default fill direction.

Parameters

Example Usage

local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(frame, 100, 100)
DCEI.SetFrameImage(frame, DCEI.Texture("airship_onMap"))
DCEI.SetFrameImageFillAmount(frame, 0.5)
DCEI.SetFrameImageFillHorizontal(frame)

void SetFrameImageFillVertical(InGameUILayoutComponent ui)

void SetFrameImageFillVertical(InGameUILayoutComponent ui)

Description


Sets the background image fill for a frame to be vertical. The default fill direction is horizontal.

Parameters

Example Usage

local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(frame, 100, 100)
DCEI.SetFrameImage(frame, DCEI.Texture("airship_onMap"))
DCEI.SetFrameImageFillAmount(frame, 0.5)
DCEI.SetFrameImageFillVertical(frame)

void SetFrameImageFillRadial(InGameUILayoutComponent ui)

void SetFrameImageFillRadial(InGameUILayoutComponent ui)

Description


Sets the background image fill for a frame to be radial. This is useful for making circular progress bars. The default fill direction is horizontal.

Parameters

Example Usage

local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(frame, 100, 100)
DCEI.SetFrameImage(frame, DCEI.Texture("airship_onMap"))
DCEI.SetFrameImageFillAmount(frame, 0.75)
DCEI.SetFrameImageFillRadial(frame)

void SetFrameImageFillOrigin(InGameUILayoutComponent ui, int origin)

void SetFrameImageFillOrigin(InGameUILayoutComponent ui, int origin)

Description


Sets the fill progress orientation of a UI frame.

Parameters

Example Usage

local countdown = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameImage(countdown, DCEI.Texture("circle01"))
DCEI.SetFrameSize(countdown, 128, 128)

DCEI.SetFrameImageFillRadial(countdown)
DCEI.SetFrameImageFillOrigin(countdown, 1)
DCEI.SetFrameImageFillAmount(countdown, 0.75)

void SetFrameImageFillAmountExpression(InGameUILayoutComponent ui, string expression, bool inverse = False)

void SetFrameImageFillAmountExpression(InGameUILayoutComponent ui, string expression, bool inverse = False)

Description


Sets the fill amount for the background image. Expressions use data bound by BindLuaTable or BindUnitData.

Parameters

Example Usage

local vstack = DCEI.CreateVStackFrame(DCEI.GetUiRootFrame())

local data = {fill = 0.7}
DCEI.BindLuaTable("data", data)

local data_frame = DCEI.CreateFrame(vstack)
DCEI.SetFrameSize(data_frame, 100, 100)
DCEI.SetFrameImage(data_frame, DCEI.Texture("airship_onMap"))
DCEI.SetFrameImageFillAmountExpression(data_frame, "data.fill", false)

local unit_frame = DCEI.CreateFrame(vstack)
DCEI.SetFrameImage(unit_frame, "quest_page_progression_fill")
DCEI.SetFrameSize(unit_frame, 100, 10)

local unit = DCEI.CreateUnit(1, 1, DCEI.Unit("Standard MeleeUnit"), 16, 16, 0, -1)
DCEI.BindUnitData("selected", unit)
DCEI.SetFrameImageFillAmountExpression(unit_frame, "selected.Health.Fraction", false)

void SetFrameWidthExpression(InGameUILayoutComponent ui, string expression)

void SetFrameWidthExpression(InGameUILayoutComponent ui, string expression)

Description


Sets the width of a UI frame. Expressions use data bound by BindLuaTable or BindUnitData.

Parameters

Example Usage

local vstack = DCEI.CreateVStackFrame(DCEI.GetUiRootFrame())

local data_frame = DCEI.CreateFrame(vstack)
DCEI.SetFrameImageColor(data_frame, {r = 0.5, g = 0, b = 1, a = 1})

local data = {width = 100, height = 100}
DCEI.BindLuaTable("data", data)
DCEI.SetFrameWidthExpression(data_frame, "data.width")
DCEI.SetFrameHeightExpression(data_frame, "data.height")

local unit_frame = DCEI.CreateFrame(vstack)
DCEI.SetFrameImageColor(unit_frame, {r = 0, g = 1, b = 0.5, a = 1})

local unit = DCEI.CreateUnit(1, 1, DCEI.Unit("Standard MeleeUnit"), 16, 16, 0, -1)
DCEI.BindUnitData("selected", unit)
DCEI.SetFrameWidthExpression(unit_frame, "selected.Health.Max")
DCEI.SetFrameHeightExpression(unit_frame, "selected.Health.Current")

void SetFrameHeightExpression(InGameUILayoutComponent ui, string expression)

void SetFrameHeightExpression(InGameUILayoutComponent ui, string expression)

Description


Sets the height of a UI frame. Expressions use data bound by BindLuaTable or BindUnitData.

Parameters

Example Usage

local vstack = DCEI.CreateVStackFrame(DCEI.GetUiRootFrame())

local data_frame = DCEI.CreateFrame(vstack)
DCEI.SetFrameImageColor(data_frame, {r = 0.5, g = 0, b = 1, a = 1})

local data = {width = 100, height = 100}
DCEI.BindLuaTable("data", data)
DCEI.SetFrameWidthExpression(data_frame, "data.width")
DCEI.SetFrameHeightExpression(data_frame, "data.height")

local unit_frame = DCEI.CreateFrame(vstack)
DCEI.SetFrameImageColor(unit_frame, {r = 0, g = 1, b = 0.5, a = 1})

local unit = DCEI.CreateUnit(1, 1, DCEI.Unit("Standard MeleeUnit"), 16, 16, 0, -1)
DCEI.BindUnitData("selected", unit)
DCEI.SetFrameWidthExpression(unit_frame, "selected.Health.Max")
DCEI.SetFrameHeightExpression(unit_frame, "selected.Health.Current")

void SetFrameImageColor(InGameUILayoutComponent ui, ColorRGBA color)

void SetFrameImageColor(InGameUILayoutComponent ui, ColorRGBA color)

Description


Applies a tint color to the frame using RGBA values (valid values are between 0 and 1). Note that frames without background images can be tinted a solid color. Alpha 1 is completely opaque, alpha 0 is completely transparent.

Parameters

Example Usage

local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameImageColor(frame, {r = 0.5, g = 0.5, b = 0, a = 0.5})

void SetFrameImageColorExpression(InGameUILayoutComponent ui, string r, string g, string b, string a)

void SetFrameImageColorExpression(InGameUILayoutComponent ui, string r, string g, string b, string a)

Description


Applies a tint color to the frame using RGBA values (valid values are between 0 and 1). Note that frames without background images can be tinted a solid color. Alpha 1 is completely opaque, alpha 0 is completely transparent. Expressions use data bound by BindLuaTable or BindUnitData.

Parameters

Example Usage

local vstack = DCEI.CreateVStackFrame(DCEI.GetUiRootFrame())

local data = {bg_color = {r = 0.5, g = 0, b = 1, a = 1}}
DCEI.BindLuaTable("data", data)

local data_frame = DCEI.CreateFrame(vstack)
DCEI.SetFrameSize(data_frame, 200, 100)
DCEI.SetFrameImageColorExpression(data_frame, "data.bg_color.r", "data.bg_color.g", "data.bg_color.b", "data.bg_color.a")

local unit_frame = DCEI.CreateFrame(vstack)
DCEI.SetFrameSize(unit_frame, 200, 100)

local unit = DCEI.CreateUnit(1, 1, DCEI.Unit("Standard MeleeUnit"), 16, 16, 0, -1)
DCEI.BindUnitData("selected", unit)

local rgbval = "selected.Health.Fraction"
DCEI.SetFrameImageColorExpression(unit_frame, rgbval, rgbval, rgbval, rgbval)

void SetFrameImageGrayScale(InGameUILayoutComponent ui, bool isGrayScale)

void SetFrameImageGrayScale(InGameUILayoutComponent ui, bool isGrayScale)

Description


Sets if the background image is rendered in gray scale for a UI frame.

Parameters

Example Usage

local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(frame, 100, 100)
DCEI.SetFrameImage(frame, DCEI.Texture("airship_onMap"))
DCEI.SetFrameImageGrayScale(frame, true)

void SetFrameTooltipText(InGameUILayoutComponent ui, string text)

void SetFrameTooltipText(InGameUILayoutComponent ui, string text)

Description


Sets the tooltip text for a UI frame. Child frame tooltips will display over parent frame tooltips.

Parameters

Example Usage

local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(frame, 100, 100)
DCEI.SetFrameImage(frame, DCEI.Texture("airship_onMap"))
DCEI.SetFrameTooltipText(frame, "Frame 1")

void SetFrameTooltipOffset(int offset)

void SetFrameTooltipOffset(int offset)

Description


Sets the tooltip offset from the cursor. This will affect all tooltips.

Parameters

Example Usage

local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(frame, 100, 100)
DCEI.SetFrameImage(frame, DCEI.Texture("airship_onMap"))
DCEI.SetFrameTooltipText(frame, "Frame 1")
DCEI.SetFrameTooltipOffset(100)

void SetFrameTooltipStyle(int style)

void SetFrameTooltipStyle(int style)

Description


Sets the tooltip style. This will affect all tooltips. By default, tooltips are displayed next to the cursor.

Parameters

Example Usage

local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(frame, 100, 100)
DCEI.SetFrameImage(frame, DCEI.Texture("airship_onMap"))
DCEI.SetFrameTooltipText(frame, "Frame 1")
DCEI.SetFrameTooltipStyle(1)

void SetFrameTooltipPosition(int position)

void SetFrameTooltipPosition(int position)

Description


Sets the tooltip position. This will affect all tooltips.

Parameters

Example Usage

local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(frame, 100, 100)
DCEI.SetFrameImage(frame, DCEI.Texture("airship_onMap"))
DCEI.SetFrameTooltipText(frame, "Frame 1")
DCEI.SetFrameTooltipPosition(1)

void SetFrameTooltipImage(string name)

void SetFrameTooltipImage(string name)

Description


Sets a background image for tooltips. This will affect all tooltips.

Parameters

Example Usage

local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(frame, 100, 100)
DCEI.SetFrameImage(frame, DCEI.Texture("airship_onMap"))
DCEI.SetFrameTooltipText(frame, "Frame 1")
DCEI.SetFrameTooltipImage(DCEI.Texture("airship_onMap"))

void SetFrameTooltipFontSize(int size)

void SetFrameTooltipFontSize(int size)

Description


Sets the tooltip font size. This will affect all tooltips.

Parameters

Example Usage

local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(frame, 100, 100)
DCEI.SetFrameImage(frame, DCEI.Texture("airship_onMap"))
DCEI.SetFrameTooltipText(frame, "Frame 1")
DCEI.SetFrameTooltipFontSize(50)

void SetFrameTooltipPadding(int left, int right, int top, int bottom)

void SetFrameTooltipPadding(int left, int right, int top, int bottom)

Description


Sets the tooltip padding. This will affect all tooltips.

Parameters

Example Usage

local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(frame, 100, 100)
DCEI.SetFrameImage(frame, DCEI.Texture("airship_onMap"))
DCEI.SetFrameTooltipText(frame, "Frame 1")
DCEI.SetFrameTooltipPadding(30, 30, 30, 30)

void SetFrameTooltipMaxWidth(int width)

void SetFrameTooltipMaxWidth(int width)

Description


Sets the tooltip max width. Tooltip text that exceeds this width will wrap. This will affect all tooltips.

Parameters

Example Usage

local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(frame, 100, 100)
DCEI.SetFrameImage(frame, DCEI.Texture("airship_onMap"))
DCEI.SetFrameTooltipText(frame, "Frame 1")
DCEI.SetFrameTooltipFontSize(50)
DCEI.SetFrameTooltipMaxWidth(100)

void SetFrameTooltipTextColor(ColorRGB color)

void SetFrameTooltipTextColor(ColorRGB color)

Description


Sets the tooltip text color. This will affect all tooltips.

Parameters

Example Usage

local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(frame, 100, 100)
DCEI.SetFrameImage(frame, DCEI.Texture("airship_onMap"))
DCEI.SetFrameTooltipText(frame, "Frame 1")
DCEI.SetFrameTooltipTextColor({r = 0.5, g = 0.5, b = 0})

void SetButtonFrameClickSound(InGameUILayoutComponent ui, string path)

void SetButtonFrameClickSound(InGameUILayoutComponent ui, string path)

Description


Sets the click sound for the given button.

Parameters

Example Usage

local button = DCEI.CreateButtonFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(button, 100, 100)
DCEI.SetButtonFrameClickSound(button, DCEI.Sound("ancienttree_ability_01"))

void SetButtonFrameEnable(InGameUILayoutComponent ui, bool enable)

void SetButtonFrameEnable(InGameUILayoutComponent ui, bool enable)

Description


Enables or disables a button. Disabled buttons don't accept mouse input and have their background image tinted darker unless given a SetButtonFrameDisabledImage.

Parameters

Example Usage

local button = DCEI.CreateButtonFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(button, 100, 100)
DCEI.SetButtonFrameEnable(button, false)

void SetButtonFrameDisabledImage(InGameUILayoutComponent ui, string name)

void SetButtonFrameDisabledImage(InGameUILayoutComponent ui, string name)

Description


Sets the background image for a button while it is disabled.

Parameters

Example Usage

local button = DCEI.CreateButtonFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(button, 100, 100)
DCEI.SetButtonFrameEnable(button, false)
DCEI.SetButtonFrameDisabledImage(button, DCEI.Texture("airship_onMap"))

void SetFrameRotation(InGameUILayoutComponent ui, float degrees)

void SetFrameRotation(InGameUILayoutComponent ui, float degrees)

Description


Sets the rotation for a UI frame and its children.

Parameters

Example Usage

local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(frame, 100, 100)
DCEI.SetFrameImageColor(frame, {r = 1, g = 0, b = 1, a = 0.5})
DCEI.SetFrameRotation(frame, 45)

void SetFrameRotation3D(InGameUILayoutComponent ui, float x, float y, float z)

void SetFrameRotation3D(InGameUILayoutComponent ui, float x, float y, float z)

Description


Rotates a frame and its children in 3D space. DCEI.SetFrameRotation3D(ui, 0, 180, 0) will flip an image horizontally.

Parameters

Example Usage

local big_hand = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameImage(big_hand, DCEI.Texture("pointy_finger"))
DCEI.SetFrameSize(big_hand, 108, 87)
DCEI.SetFrameRotation3D(big_hand, 0, 180, 0)

void BindUnitData(string name, unit unit)

void BindUnitData(string name, unit unit)

Description


Bind a given unit to a key, allowing the unit's attributes to be accessed by expressions.

Parameters

unit.Info.Icon
unit.Info.Name
unit.Health.Current
unit.Health.Max
unit.Health.Percentage
unit.Health.Fraction
unit.Health.Regeneration
unit.Shield.Current
unit.Shield.Max
unit.Shield.Percentage
unit.Shield.Fraction
unit.Shield.Regeneration
unit.Mana.Current
unit.Mana.Max
unit.Mana.Percentage
unit.Mana.Fraction
unit.Mana.Regeneration
unit.Ability.ability_name.CooldownRatio
unit.Ability.ability_name.MaxCharge
unit.Ability.ability_name.ChargeCount
unit.Expression.some_named_expression

Example Usage

-- create and bind a unit
local unit = DCEI.CreateUnit(1, 1, DCEI.Unit("Standard MeleeUnit"), 16, 16, 0, -1)
DCEI.BindUnitData("selected", unit)

local stats = {}
local vstack = DCEI.CreateVStackFrame(DCEI.GetUiRootFrame())
stats.health_label = DCEI.CreateTextFrame(vstack)

-- make it so that the healthbar shows <current HP>/<max HP>
DCEI.SetTextFrameTextExpression(stats.health_label, "{selected.Health.Current}/{selected.Health.Max}")

-- damage unit every second
DCEI.TriggerAddTimerEventPeriodicIndefinite(
    function()
        DCEI.SetHealth(unit, DCEI.GetHealth(unit) - 1)
    end,
    1, true
)

void BindLuaTable(string name, object value)

void BindLuaTable(string name, object value)

Description


Binds a lua table to a string, allowing the data inside to be accessed by expressions. Updating the bound table values will update any UI that reference these values in an expression. Some expressions evaluate 1 and 0 as true and false, respectively. See also BindUnitData

Parameters

Example Usage

-- create and bind a data table
local data_table = {
    score = 0
}
DCEI.BindLuaTable("data", data_table)

-- create a new text frame and bind its text to the score variable
local label = DCEI.CreateTextFrame(DCEI.GetUiRootFrame())
DCEI.SetTextFrameTextExpression(label, "Score: {data.score}")

-- increment score every second
DCEI.TriggerAddTimerEventPeriodicIndefinite(
    function()
        data_table.score = data_table.score + 1 
    end,
    1, true
)

bool IsFrameActive(InGameUILayoutComponent ui)

bool IsFrameActive(InGameUILayoutComponent ui)

Description


Returns whether the given UI frame is active.

Parameters

Example Usage

local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(frame, 100, 100)
DCEI.SetFrameImageColor(frame, {r = 1, g = 0, b = 1, a = 0.5})

local is_active = DCEI.IsFrameActive(frame)
DCEI.LogMessage(tostring(is_active))

void SetFrameActive(InGameUILayoutComponent ui, bool value)

void SetFrameActive(InGameUILayoutComponent ui, bool value)

Description


Sets whether the given UI frame and its children are active. Inactive frames are not displayed.

Creating new UI frames under inactive parent frames can cause issues and should be avoided. You can use UpdateFrame to safely create new frames under inactive parents.

Parameters

Example Usage

local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(frame, 100, 100)
DCEI.SetFrameImageColor(frame, {r = 1, g = 0, b = 1, a = 0.5})

DCEI.SetFrameActive(frame, false)

void SetFrameBlockInput(InGameUILayoutComponent ui, bool value)

void SetFrameBlockInput(InGameUILayoutComponent ui, bool value)

Description


Makes a UI frame block all input. Requires a SetFrameImage to be set (but it can be made SetFrameImageColor).

Parameters

Example Usage

local fullscreen_mask = DCEI.CreateFrame(DCEI.GetUiRootFrame())

DCEI.SetFrameMatchParent(fullscreen_mask, true)
DCEI.SetFrameImageColor(fullscreen_mask, {r = 0, g = 0, b = 0, a = 0.5})
DCEI.SetFrameBlockInput(fullscreen_mask, true)

void AttachFrameToUnit(InGameUILayoutComponent ui, unit unit, UnitLabelOptions options, bool useCurrentUiRoot = False)

void AttachFrameToUnit(InGameUILayoutComponent ui, unit unit, UnitLabelOptions options, bool useCurrentUiRoot = False)

Description


Attaches a UI frame to a unit, useful for creating custom health and status bars.

Parameters

Example Usage

local frame = DCEI.CreateTextFrame(DCEI.GetUiRootFrame())
DCEI.SetTextFrameText(frame, "Bob")

local unit = DCEI.CreateUnit(1, 1, DCEI.Unit("Standard MeleeUnit"), 16, 16, 0, -1)

local options = {
    offset = {up = 1.2},
    center_at_unit_origin = true
}

DCEI.AttachFrameToUnit(frame, unit, options)

void SetMouseCursorFrame(InGameUILayoutComponent ui)

void SetMouseCursorFrame(InGameUILayoutComponent ui)

Description


Using an UI to replace current cursor image

Parameters

Example Usage

local frame = DCEI.CreateTextFrame(DCEI.GetUiRootFrame())
DCEI.SetTextFrameText(frame, "Bob")

DCEI.SetMouseCursorFrame(frame)

void SetMouseCursorFrameForPlayer(int player, InGameUILayoutComponent ui)

void SetMouseCursorFrameForPlayer(int player, InGameUILayoutComponent ui)

Description


Set cursor image only for a specific player. Only useful in multiplayer.

Parameters

Example Usage

local frame = DCEI.CreateTextFrame(DCEI.GetUiRootFrame())
DCEI.SetTextFrameText(frame, "Bob")

DCEI.SetMouseCursorFrameForPlayer(1, frame)

void AttachOffscreenUnitIndicatorFrame(InGameUILayoutComponent ui, unit unit, InGameUILayoutComponent rotatingPointerChildFrame = null)

void AttachOffscreenUnitIndicatorFrame(InGameUILayoutComponent ui, unit unit, InGameUILayoutComponent rotatingPointerChildFrame = null)

Description


Attaches a UI frame as an offscreen indicator to a unit. This frame will only be visible if the related unit is off screen for the viewing player.

Parameters

Example Usage

local unit = DCEI.CreateUnit(1, 1, DCEI.Unit("Standard MeleeUnit"), 30, 30, 0, -1)
DCEI.Move(unit, 30, 0)

local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameImageColor(frame, {r = 1, g = 1, b = 1, a = 0.5})
DCEI.SetFrameSize(frame, 100, 100)

local frame2 = DCEI.CreateFrame(frame)
DCEI.SetFrameImage(frame2, DCEI.Texture("airship_onMap"))
DCEI.SetFrameSize(frame2, 100, 100)

DCEI.AttachOffscreenUnitIndicatorFrame(frame, unit, frame2)

void SetOffscreenUnitIndicatorFrameCanvasOffset(InGameUILayoutComponent ui, Float2 offset)

void SetOffscreenUnitIndicatorFrameCanvasOffset(InGameUILayoutComponent ui, Float2 offset)

Description


Adjusts the offset of the frame that has been attached using the AttachOffscreenUnitIndicatorFrame API.

Parameters

Example Usage

local unit = DCEI.CreateUnit(1, 1, DCEI.Unit("Standard MeleeUnit"), 30, 30, 0, -1)
DCEI.Move(unit, 30, 0)

local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameImageColor(frame, {r = 1, g = 1, b = 1, a = 0.5})
DCEI.SetFrameSize(frame, 100, 100)

local frame2 = DCEI.CreateFrame(frame)
DCEI.SetFrameImage(frame2, DCEI.Texture("airship_onMap"))
DCEI.SetFrameSize(frame2, 100, 100)

DCEI.AttachOffscreenUnitIndicatorFrame(frame, unit, frame2)
DCEI.SetOffscreenUnitIndicatorFrameCanvasOffset(frame, 2)

void MoveFrameToTop(InGameUILayoutComponent ui)

void MoveFrameToTop(InGameUILayoutComponent ui)

Description


Moves a UI frame (and all of its parents) above all sibling UI frames.

Parameters

Example Usage

local frame1 = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(frame1, 200, 200)
DCEI.SetFrameHorizontalOffsetInParent(frame1, -50)
DCEI.SetFrameImageColor(frame1, {r = 1, g = 0, b = 0, a = 1})

local frame2 = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(frame2, 200, 200)
DCEI.SetFrameHorizontalOffsetInParent(frame2, 50)
DCEI.SetFrameImageColor(frame2, {r = 0, g = 0, b = 1, a = 1})

DCEI.TriggerAddTimerEventElapsed(
    function()
        -- frame1 is moved above frame2, by default frame2 will overlap frame1
        DCEI.MoveFrameToTop(frame1)
    end,
    1,
    true
)

void MoveFrameToBottom(InGameUILayoutComponent ui)

void MoveFrameToBottom(InGameUILayoutComponent ui)

Description


Moves a UI frame (and all of its parents) below all sibling UI frames.

Parameters

Example Usage

local frame1 = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(frame1, 200, 200)
DCEI.SetFrameHorizontalOffsetInParent(frame1, -50)
DCEI.SetFrameImageColor(frame1, {r = 1, g = 0, b = 0, a = 1})

local frame2 = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(frame2, 200, 200)
DCEI.SetFrameHorizontalOffsetInParent(frame2, 50)
DCEI.SetFrameImageColor(frame2, {r = 0, g = 0, b = 1, a = 1})

DCEI.TriggerAddTimerEventElapsed(
  function()
        -- frame2 is moved below frame1, by default frame2 will overlap frame1
        DCEI.MoveFrameToBottom(frame2)
    end,
    1,
    true
)

void SetPauseButtonFrame(InGameUILayoutComponent ui)

void SetPauseButtonFrame(InGameUILayoutComponent ui)

Description


Sets a button to be used as the game's pause button. Setting this will replace the default pause button in the top right corner (hiding the default UI).

Parameters

Example Usage

local button = DCEI.CreateButtonFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(button, 100, 100)
DCEI.SetPauseButtonFrame(button)

void SetPauseMenuFrame(InGameUILayoutComponent ui)

void SetPauseMenuFrame(InGameUILayoutComponent ui)

Description


Sets a UI frame to be the pause menu, replacing the default pause menu UI and functionality.

Parameters

Example Usage

-- create a custom pause menu
local menu = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(menu, 400, 600)
DCEI.SetFrameImage(menu, DCEI.Texture("frame01_purple"))
DCEI.SetPauseMenuFrame(menu)

-- the pause menu is inactive by default but we can update it safely with UpdateFrame
DCEI.UpdateFrame(
    menu,
    function()
        local resume_button = DCEI.CreateButtonFrame(menu)
        DCEI.SetFrameSize(resume_button, 200, 100)
        DCEI.SetOnClickCallback(
            resume_button, 
            function()
                DCEI.HidePauseMenuFrame(menu)
            end
        )
    end
)

-- create a custom pause menu button
local pause_button = DCEI.CreateButtonFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameImage(pause_button, DCEI.Texture("btn_red"))
DCEI.SetFrameTopAlignmentInParent(pause_button)
DCEI.SetFrameLeftAlignmentInParent(pause_button)
DCEI.SetFrameSize(pause_button, 200, 200)

-- hookup the pause menu button callback
DCEI.SetOnClickCallback(
    pause_button,
    function()
        DCEI.ShowPauseMenuFrame(menu)
    end
)

-- add custom pause menu callback
DCEI.SetPauseMenuCallback(
    function(pause)
        if pause then
            Core.GameSpeed.Set(0)
        else
            Core.GameSpeed.Set(1)
        end
    end
)

void ShowPauseMenuFrame()

void ShowPauseMenuFrame()

Description


Show the current pause menu.

Example Usage

-- create a custom pause menu
local menu = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(menu, 400, 600)
DCEI.SetFrameImage(menu, DCEI.Texture("frame01_purple"))
DCEI.SetPauseMenuFrame(menu)

-- the pause menu is inactive by default but we can update it safely with UpdateFrame
DCEI.UpdateFrame(
    menu,
    function()
        local resume_button = DCEI.CreateButtonFrame(menu)
        DCEI.SetFrameSize(resume_button, 200, 100)
        DCEI.SetOnClickCallback(
            resume_button, 
            function()
                DCEI.HidePauseMenuFrame(menu)
            end
        )
    end
)

-- create a custom pause menu button
local pause_button = DCEI.CreateButtonFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameImage(pause_button, DCEI.Texture("btn_red"))
DCEI.SetFrameTopAlignmentInParent(pause_button)
DCEI.SetFrameLeftAlignmentInParent(pause_button)
DCEI.SetFrameSize(pause_button, 200, 200)

-- hookup the pause menu button callback
DCEI.SetOnClickCallback(
    pause_button,
    function()
        DCEI.ShowPauseMenuFrame(menu)
    end
)

-- add custom pause menu callback
DCEI.SetPauseMenuCallback(
    function(pause)
        if pause then
            Core.GameSpeed.Set(0)
        else
            Core.GameSpeed.Set(1)
        end
    end
)

void HidePauseMenuFrame()

void HidePauseMenuFrame()

Description


Hide the pause menu frame.

Example Usage

-- create a custom pause menu
local menu = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(menu, 400, 600)
DCEI.SetFrameImage(menu, DCEI.Texture("frame01_purple"))
DCEI.SetPauseMenuFrame(menu)

-- the pause menu is inactive by default but we can update it safely with UpdateFrame
DCEI.UpdateFrame(
    menu,
    function()
        local resume_button = DCEI.CreateButtonFrame(menu)
        DCEI.SetFrameSize(resume_button, 200, 100)
        DCEI.SetOnClickCallback(
            resume_button, 
            function()
                DCEI.HidePauseMenuFrame(menu)
            end
        )
    end
)

-- create a custom pause menu button
local pause_button = DCEI.CreateButtonFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameImage(pause_button, DCEI.Texture("btn_red"))
DCEI.SetFrameTopAlignmentInParent(pause_button)
DCEI.SetFrameLeftAlignmentInParent(pause_button)
DCEI.SetFrameSize(pause_button, 200, 200)

-- hookup the pause menu button callback
DCEI.SetOnClickCallback(
    pause_button,
    function()
        DCEI.ShowPauseMenuFrame(menu)
    end
)

-- add custom pause menu callback
DCEI.SetPauseMenuCallback(
    function(pause)
        if pause then
            Core.GameSpeed.Set(0)
        else
            Core.GameSpeed.Set(1)
        end
    end
)

void SetPauseMenuFrameMusicButton(InGameUILayoutComponent ui)

void SetPauseMenuFrameMusicButton(InGameUILayoutComponent ui)

Description


Replace default music button to this UI.

Parameters

Example Usage

local music_button = DCEI.CreateButtonFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(music_button, 200, 200)
DCEI.SetFrameImage(music_button, DCEI.Texture("btn_blue"))
DCEI.SetPauseMenuFrameMusicButton(music_button)

void SetPauseMenuFrameSoundButton(InGameUILayoutComponent ui)

void SetPauseMenuFrameSoundButton(InGameUILayoutComponent ui)

Description


Replace default sound button to this UI.

Parameters

Example Usage

local sound_button = DCEI.CreateButtonFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(sound_button, 200, 200)
DCEI.SetFrameImage(sound_button, DCEI.Texture("btn_blue"))
DCEI.SetPauseMenuFrameMusicButton(sound_button)

void SetPauseMenuFrameResumeButton(InGameUILayoutComponent ui)

void SetPauseMenuFrameResumeButton(InGameUILayoutComponent ui)

Description


Sets the pause menu resume button. This button will exit the pause menu.

Parameters

Example Usage

local button = DCEI.CreateButtonFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(button, 100, 100)
DCEI.SetPauseButtonFrame(button)

local menu = DCEI.CreateVStackFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(menu, 400, 600)
DCEI.SetFrameImage(menu,  DCEI.Texture("frame01_purple"))

local resume = DCEI.CreateButtonFrame(menu)
DCEI.SetFrameSize(resume, 400, 200)
DCEI.SetPauseMenuFrameResumeButton(resume)

local resume_text = DCEI.CreateTextFrame(resume)
DCEI.SetTextFrameText(resume_text, "Resume")

DCEI.SetPauseMenuFrame(menu)

void SetPauseMenuFrameQuitButton(InGameUILayoutComponent ui)

void SetPauseMenuFrameQuitButton(InGameUILayoutComponent ui)

Description


Sets the pause menu quit button. This button will exit the game.

Parameters

Example Usage

local button = DCEI.CreateButtonFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(button, 100, 100)
DCEI.SetPauseButtonFrame(button)

local menu = DCEI.CreateVStackFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameImage(menu,  DCEI.Texture("frame01_purple"))
DCEI.SetFramePadding(menu, 20)
DCEI.SetFrameSpacing(menu, 20)

local resume = DCEI.CreateButtonFrame(menu)
DCEI.SetFrameSize(resume, 200, 100)
DCEI.SetPauseMenuFrameResumeButton(resume)

local resume_text = DCEI.CreateTextFrame(resume)
DCEI.SetTextFrameText(resume_text, "Resume")

local quit = DCEI.CreateButtonFrame(menu)
DCEI.SetFrameSize(quit, 200, 100)
DCEI.SetPauseMenuFrameQuitButton(quit)

local quit_text = DCEI.CreateTextFrame(quit)
DCEI.SetTextFrameText(quit_text, "Quit")

DCEI.SetPauseMenuFrame(menu)

void SetPauseMenuFrameRestartButton(InGameUILayoutComponent ui)

void SetPauseMenuFrameRestartButton(InGameUILayoutComponent ui)

Description


Sets the pause menu restart button. This button will restart the game.

Parameters

Example Usage

local button = DCEI.CreateButtonFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(button, 100, 100)
DCEI.SetPauseButtonFrame(button)

local menu = DCEI.CreateVStackFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameImage(menu,  DCEI.Texture("frame01_purple"))
DCEI.SetFramePadding(menu, 20)
DCEI.SetFrameSpacing(menu, 20)

local resume = DCEI.CreateButtonFrame(menu)
DCEI.SetFrameSize(resume, 200, 100)
DCEI.SetPauseMenuFrameResumeButton(resume)

local resume_text = DCEI.CreateTextFrame(resume)
DCEI.SetTextFrameText(resume_text, "Resume")

local quit = DCEI.CreateButtonFrame(menu)
DCEI.SetFrameSize(quit, 200, 100)
DCEI.SetPauseMenuFrameQuitButton(quit)

local quit_text = DCEI.CreateTextFrame(quit)
DCEI.SetTextFrameText(quit_text, "Quit")

local restart = DCEI.CreateButtonFrame(menu)
DCEI.SetFrameSize(restart, 200, 100)
DCEI.SetPauseMenuFrameRestartButton(restart)

local restart_text = DCEI.CreateTextFrame(restart)
DCEI.SetTextFrameText(restart_text, "Restart")

DCEI.SetPauseMenuFrame(menu)

void SetPauseMenuFramePlayLevelButton(InGameUILayoutComponent ui, string path, string displayName)

void SetPauseMenuFramePlayLevelButton(InGameUILayoutComponent ui, string path, string displayName)

Description


Sets the pause menu play level button. This button will play the specified level, exiting the current one.

Parameters

Example Usage

local button = DCEI.CreateButtonFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(button, 100, 100)
DCEI.SetPauseButtonFrame(button)

local menu = DCEI.CreateVStackFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameImage(menu,  DCEI.Texture("frame01_purple"))
DCEI.SetFramePadding(menu, 20)
DCEI.SetFrameSpacing(menu, 20)

local resume = DCEI.CreateButtonFrame(menu)
DCEI.SetFrameSize(resume, 200, 100)
DCEI.SetPauseMenuFrameResumeButton(resume)

local resume_text = DCEI.CreateTextFrame(resume)
DCEI.SetTextFrameText(resume_text, "Resume")

local quit = DCEI.CreateButtonFrame(menu)
DCEI.SetFrameSize(quit, 200, 100)
DCEI.SetPauseMenuFrameQuitButton(quit)

local quit_text = DCEI.CreateTextFrame(quit)
DCEI.SetTextFrameText(quit_text, "Quit")

local restart = DCEI.CreateButtonFrame(menu)
DCEI.SetFrameSize(restart, 200, 100)
DCEI.SetPauseMenuFrameRestartButton(restart)

local restart_text = DCEI.CreateTextFrame(restart)
DCEI.SetTextFrameText(restart_text, "Restart")

local play_level = DCEI.CreateButtonFrame(menu)
DCEI.SetFrameSize(play_level, 200, 100)
DCEI.SetPauseMenuFramePlayLevelButton(play_level, "Workshop 02 - Debugging & Foundations", "Level")

local play_level_text = DCEI.CreateTextFrame(play_level)
DCEI.SetTextFrameText(play_level_text, "Open Workshop 02")

DCEI.SetPauseMenuFrame(menu)

void SuppressPauseMenuOnApplicationPause()

void SuppressPauseMenuOnApplicationPause()

Description


Suppresses the pause menu on application pause. This is necessary if your game features in-game ads, as the ads screen will pause the application and show the pause menu by default.

Example Usage

function ResolveAds(success)
    if success then
        -- deliver ad rewards to player
    else
        -- show error message for player
    end
end

DCEI.SuppressPauseMenuOnApplicationPause()
DCEI.ShowAds(ResolveAds)

Float3 GetFrameCanvasPosition3D(InGameUILayoutComponent ui)

Float3 GetFrameCanvasPosition3D(InGameUILayoutComponent ui)

Description


Returns the 3D Position of a UI frame. Similar to other UI getters, you may need to wait a frame after any UI adjustments to get the latest position.

Parameters

Example Usage

local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameVerticalOffsetInParent(frame, 200)

-- wait a frame to get the new UI position
DCEI.TriggerAddTimerEventElapsed(
    function()
        local pos = DCEI.GetFrameCanvasPosition3D(frame)
        DCEI.LogMessage(string.format("Frame X position: %f, Y position: %f, Z position: %f", pos.x, pos.y, pos.z))
    end,
    0, 
    true
)

Float3 GetCanvasPositionFromWorldPosition(Float3 worldPosition)

Float3 GetCanvasPositionFromWorldPosition(Float3 worldPosition)

Description


Transfomr world position to UI position

Parameters

Example Usage

local unit_frame_position = DCEI.GetCanvasPositionFromWorldPosition(unit_position)
DCEI.MoveFrameToCanvasPosition(ui_coin_frame, unit_frame_position, {right = 0, up = 0, front = 0})

Float3 GetWorldPositionFromCanvasPosition(Float3 canvasPosition)

Float3 GetWorldPositionFromCanvasPosition(Float3 canvasPosition)

Description

Parameters

Example Usage

void MoveFrameToCanvasPosition(InGameUILayoutComponent ui, Float3 canvasPosition, Offset offset = default)

void MoveFrameToCanvasPosition(InGameUILayoutComponent ui, Float3 canvasPosition, Offset offset = default)

Description


Move a certain UI to new position

Parameters

Example Usage

local unit_frame_position = DCEI.GetCanvasPositionFromWorldPosition(unit_position)
DCEI.MoveFrameToCanvasPosition(ui_coin_frame, unit_frame_position, {right = 0, up = 0, front = 0})

void SetFrameAnimationLoops(Tweener tweener, int loops, LoopType loopType)

void SetFrameAnimationLoops(Tweener tweener, int loops, LoopType loopType)

Description


Plays a given UI animation a specified number of loops.

Parameters

Example Usage

local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameImageColor(frame, {r = 1, g = 0, b = 1, a = 1})
DCEI.SetFrameSize(frame, 100, 100)

local k1, k2 = 0.5, 1.5
local duration = 2
local easing = "InCubic"
local anim = DCEI.AnimateFrameScale(frame, {x = k1, y = k1, z = k1}, {x = k2, y = k2, z = k2}, duration, easing)
DCEI.SetFrameAnimationLoops(anim, -1, "Yoyo")

void StopFrameAnimation(Tweener tweener, bool waitAnimationComplete = False)

void StopFrameAnimation(Tweener tweener, bool waitAnimationComplete = False)

Description


Stops a frame animation.

Parameters

Example Usage

local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(frame, 100, 100)
local duration = 2
local ease = "Linear"
local animation = DCEI.AnimateFrameImageColor(frame, {r = 0, g = 0, b = 0, a = 1}, {r = 1, g = 1, b = 1, a = 1}, duration, ease)
-- Changed my mind! Stop the animation!
DCEI.StopFrameAnimation(animation, true)

void PauseFrameAnimation(Tweener tweener)

void PauseFrameAnimation(Tweener tweener)

Description

Parameters

Example Usage

void ResumeFrameAnimation(Tweener tweener)

void ResumeFrameAnimation(Tweener tweener)

Description

Parameters

Example Usage

void SetFrameAnimationSpeed(Tweener tweener, float speed)

void SetFrameAnimationSpeed(Tweener tweener, float speed)

Description


Set the speed factor of a frame animation.

Parameters

Example Usage

local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(frame, 100, 100)
local duration = 2
local ease = "Linear"
local animation = DCEI.AnimateFrameImageColor(frame, {r = 0, g = 0, b = 0, a = 1}, {r = 1, g = 1, b = 1, a = 1}, duration, ease)
-- Changed my mind! Double the animation speed!
DCEI.SetFrameAnimationSpeed(animation, 2.0)

Tweener AnimateFrameImageColor(InGameUILayoutComponent ui, ColorRGBA start, ColorRGBA end, float duration, Ease ease)

Tweener AnimateFrameImageColor(InGameUILayoutComponent ui, ColorRGBA start, ColorRGBA end, float duration, Ease ease)

Description


Animates a UI frame's color.

Parameters

Example Usage

local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(frame, 100, 100)
local duration = 2
local ease = "Linear"
DCEI.AnimateFrameImageColor(frame, {r = 0, g = 0, b = 0, a = 1}, {r = 1, g = 1, b = 1, a = 1}, duration, ease)

Tweener AnimateFrameImageColor(InGameUILayoutComponent ui, ColorRGBA end, float duration, Ease ease)

Tweener AnimateFrameImageColor(InGameUILayoutComponent ui, ColorRGBA end, float duration, Ease ease)

Description


Animates a UI frame's color starting from the current value.

Parameters

Example Usage

local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(frame, 100, 100)
local duration = 2
local ease = "Linear"
DCEI.AnimateFrameImageColor(frame, {r = 1, g = 1, b = 1, a = 1}, duration, ease)

Tweener AnimateTextFrameColor(InGameUILayoutComponent ui, ColorRGB start, ColorRGB end, float duration, Ease ease)

Tweener AnimateTextFrameColor(InGameUILayoutComponent ui, ColorRGB start, ColorRGB end, float duration, Ease ease)

Description


Animates a UI text frame's text color.

Parameters

Example Usage

local frame = DCEI.CreateTextFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(frame, 100, 100)
DCEI.SetTextFrameText(frame, "Hello world!")
local duration = 2
local ease = "Linear"
DCEI.AnimateTextFrameColor(frame, {r = 0, g = 0, b = 0, a = 1}, {r = 1, g = 1, b = 1, a = 1}, duration, ease)

Tweener AnimateTextFrameColor(InGameUILayoutComponent ui, ColorRGB end, float duration, Ease ease)

Tweener AnimateTextFrameColor(InGameUILayoutComponent ui, ColorRGB end, float duration, Ease ease)

Description


Animates a UI text frame's text color starting from the current value.

Parameters

Example Usage

local frame = DCEI.CreateTextFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(frame, 100, 100)
DCEI.SetTextFrameText(frame, "Hello world!")
local duration = 2
local ease = "Linear"
DCEI.AnimateTextFrameColor(frame, {r = 1, g = 1, b = 1, a = 1}, duration, ease)

Tweener AnimateFrameScale(InGameUILayoutComponent ui, Float3 start, Float3 end, float duration, Ease ease)

Tweener AnimateFrameScale(InGameUILayoutComponent ui, Float3 start, Float3 end, float duration, Ease ease)

Description


Animates a UI frame's scale over time.

Parameters

Example Usage

local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameImageColor(frame, {r = 1, g = 0, b = 0, a = 1})
DCEI.SetFrameSize(frame, 100, 100)

local k1, k2 = 1, 2
local duration = 2
local ease = "InCubic"
DCEI.AnimateFrameScale(frame, {x = k1, y = k1, z = k1}, {x = k2, y = k2, z = k2}, duration, ease)

Tweener AnimateFrameScale(InGameUILayoutComponent ui, Float3 end, float duration, Ease ease)

Tweener AnimateFrameScale(InGameUILayoutComponent ui, Float3 end, float duration, Ease ease)

Description


Animates a UI frame's scale over time starting from the current value.

Parameters

Example Usage

local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameImageColor(frame, {r = 1, g = 0, b = 0, a = 1})
DCEI.SetFrameSize(frame, 100, 100)

local k1 = 2
local duration = 2
local ease = "InCubic"
DCEI.AnimateFrameScale(frame, {x = k1, y = k1, z = k1}, duration, ease)

Tweener AnimateFrameImageFillAmount(InGameUILayoutComponent ui, float start, float end, float duration, Ease ease)

Tweener AnimateFrameImageFillAmount(InGameUILayoutComponent ui, float start, float end, float duration, Ease ease)

Description


Animates a UI frame's background image fill. Requires a background image to be set, a background image color alone does not work.

Parameters

Example Usage

local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameImage(frame,  DCEI.Texture("quest_page_progression_fill"))
DCEI.SetFrameSize(frame, 100, 50)

local k1, k2 = 0, 1
local duration = 2
local ease = "Linear"
DCEI.AnimateFrameImageFillAmount(frame, k1, k2, duration, ease)

Tweener AnimateFrameImageFillAmount(InGameUILayoutComponent ui, float end, float duration, Ease ease)

Tweener AnimateFrameImageFillAmount(InGameUILayoutComponent ui, float end, float duration, Ease ease)

Description


Animates a UI frame's background image fill starting from the current value. Requires a background image to be set, a background image color alone does not work.

Parameters

Example Usage

local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameImage(frame,  DCEI.Texture("quest_page_progression_fill"))
DCEI.SetFrameSize(frame, 100, 50)

local k1 = 1
local duration = 2
local ease = "Linear"
DCEI.AnimateFrameImageFillAmount(frame, k1, duration, ease)

Tweener AnimateFrameRotation(InGameUILayoutComponent ui, Float3 start, Float3 end, float duration, Ease ease)

Tweener AnimateFrameRotation(InGameUILayoutComponent ui, Float3 start, Float3 end, float duration, Ease ease)

Description


Animates a UI frame's rotation.

Parameters

Example Usage

local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameImage(frame,  DCEI.Texture("airship_onMap"))
DCEI.SetFrameUseImageSizeRatio(frame, 1)

local k1, k2 = 0, 180
local duration = 2
local ease = "Linear"

DCEI.AnimateFrameRotation(frame, {x = 0, y = 0, z = k1}, {x = 0, y = 0, z = k2}, duration, ease)

Tweener AnimateFrameRotation(InGameUILayoutComponent ui, Float3 end, float duration, Ease ease)

Tweener AnimateFrameRotation(InGameUILayoutComponent ui, Float3 end, float duration, Ease ease)

Description


Animates a UI frame's rotation starting from its current value.

Parameters

Example Usage

local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameImage(frame,  DCEI.Texture("airship_onMap"))
DCEI.SetFrameUseImageSizeRatio(frame, 1)

local k1 = 180
local duration = 2
local ease = "Linear"

DCEI.AnimateFrameRotation(frame, {x = 0, y = 0, z = k1}, duration, ease)

Tweener AnimateFrameAlpha(InGameUILayoutComponent ui, float start, float end, float duration, Ease ease)

Tweener AnimateFrameAlpha(InGameUILayoutComponent ui, float start, float end, float duration, Ease ease)

Description


Animates a UI frame's alpha.

Parameters

Example Usage

local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameImage(frame,  DCEI.Texture("airship_onMap"))
DCEI.SetFrameUseImageSizeRatio(frame, 1)

local k1, k2 = 0, 1
local duration = 2
local ease = "Linear"

local anim = DCEI.AnimateFrameAlpha(frame, k1, k2, duration, ease)

DCEI.SetFrameAnimationLoops(anim, -1, "Yoyo")

Tweener AnimateFrameAlpha(InGameUILayoutComponent ui, float end, float duration, Ease ease)

Tweener AnimateFrameAlpha(InGameUILayoutComponent ui, float end, float duration, Ease ease)

Description


Animates a UI frame's alpha starting from its current value.

Parameters

Example Usage

local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameImage(frame,  DCEI.Texture("airship_onMap"))
DCEI.SetFrameUseImageSizeRatio(frame, 1)

local k1 = 1
local duration = 2
local ease = "Linear"

local anim = DCEI.AnimateFrameAlpha(frame, k1, duration, ease)

Tweener AnimateFrameHorizontalOffset(InGameUILayoutComponent ui, float start, float end, float duration, Ease ease)

Tweener AnimateFrameHorizontalOffset(InGameUILayoutComponent ui, float start, float end, float duration, Ease ease)

Description


Animates a UI frame's horizontal offset.

Parameters

Example Usage

local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameImage(frame, DCEI.Texture("airship_onMap"))
DCEI.SetFrameUseImageSizeRatio(frame, 1)

local k1, k2 = 0, 500
local duration = 2
local ease = "Linear"

DCEI.AnimateFrameHorizontalOffset(frame, k1, k2, duration, ease)

Tweener AnimateFrameHorizontalOffset(InGameUILayoutComponent ui, float end, float duration, Ease ease)

Tweener AnimateFrameHorizontalOffset(InGameUILayoutComponent ui, float end, float duration, Ease ease)

Description


Animates a UI frame's horizontal offset starting from its current value.

Parameters

Example Usage

local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameImage(frame, DCEI.Texture("airship_onMap"))
DCEI.SetFrameUseImageSizeRatio(frame, 1)

local k1 = 500
local duration = 2
local ease = "Linear"

DCEI.AnimateFrameHorizontalOffset(frame, k1, duration, ease)

Tweener AnimateFrameVerticalOffset(InGameUILayoutComponent ui, float start, float end, float duration, Ease ease)

Tweener AnimateFrameVerticalOffset(InGameUILayoutComponent ui, float start, float end, float duration, Ease ease)

Description


Animates a UI frame's vertical offset.

Parameters

Example Usage

local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameImage(frame, DCEI.Texture("airship_onMap"))
DCEI.SetFrameUseImageSizeRatio(frame, 1)

local k1, k2 = 0, 500
local duration = 2
local ease = "Linear"

DCEI.AnimateFrameVerticalOffset(frame, k1, k2, duration, ease)

Tweener AnimateFrameVerticalOffset(InGameUILayoutComponent ui, float end, float duration, Ease ease)

Tweener AnimateFrameVerticalOffset(InGameUILayoutComponent ui, float end, float duration, Ease ease)

Description


Animates a UI frame's vertical offset starting from its current value.

Parameters

Example Usage

local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameImage(frame, DCEI.Texture("airship_onMap"))
DCEI.SetFrameUseImageSizeRatio(frame, 1)

local k1 = 500
local duration = 2
local ease = "Linear"

DCEI.AnimateFrameVerticalOffset(frame, k1, duration, ease)

Tweener AnimateFrameScrollPosition(InGameUILayoutComponent ui, float start, float end, float duration, Ease ease)

Tweener AnimateFrameScrollPosition(InGameUILayoutComponent ui, float start, float end, float duration, Ease ease)

Description


Animates a scroll frame's scroll position. This function is for CreateHScrollFrame and CreateVScrollFrame.

Parameters

Example Usage

local hscroll_frame = DCEI.CreateHScrollFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameImage(hscroll_frame, DCEI.Texture("frame01"))
DCEI.SetFrameSize(hscroll_frame, 350, 120)

local hscroll_content = DCEI.GetScrollFrameContent(hscroll_frame)
DCEI.SetFrameSpacing(hscroll_content, 10)
DCEI.SetFramePadding(hscroll_content, 10)

local frame1 = DCEI.CreateFrame(hscroll_content)
DCEI.SetFrameSize(frame1, 100, 100)
DCEI.SetFrameImage(frame1, DCEI.Texture("frame01_blue"))

local frame2 = DCEI.CreateFrame(hscroll_content)
DCEI.SetFrameSize(frame2, 100, 100)
DCEI.SetFrameImage(frame2, DCEI.Texture("frame01_brown"))

local frame3 = DCEI.CreateFrame(hscroll_content)
DCEI.SetFrameSize(frame3, 100, 100)
DCEI.SetFrameImage(frame3, DCEI.Texture("frame01_purple"))

local frame4 = DCEI.CreateFrame(hscroll_content)
DCEI.SetFrameSize(frame4, 100, 100)
DCEI.SetFrameImage(frame4, DCEI.Texture("frame01_grey"))

local frame5 = DCEI.CreateFrame(hscroll_content)
DCEI.SetFrameSize(frame5, 100, 100)
DCEI.SetFrameImage(frame5, DCEI.Texture("frame01_yellow"))

local k1, k2 = 0, 200
local duration = 2
local ease = "Linear"

DCEI.AnimateFrameScrollPosition(hscroll_frame, k1, k2, duration, ease)

Tweener AnimateFrameScrollPosition(InGameUILayoutComponent ui, float end, float duration, Ease ease)

Tweener AnimateFrameScrollPosition(InGameUILayoutComponent ui, float end, float duration, Ease ease)

Description


Animates a scroll frame's scroll position starting from its current value. This function is for CreateHScrollFrame and CreateVScrollFrame.

Parameters

Example Usage

local hscroll_frame = DCEI.CreateHScrollFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameImage(hscroll_frame, DCEI.Texture("frame01"))
DCEI.SetFrameSize(hscroll_frame, 350, 120)

local hscroll_content = DCEI.GetScrollFrameContent(hscroll_frame)
DCEI.SetFrameSpacing(hscroll_content, 10)
DCEI.SetFramePadding(hscroll_content, 10)

local frame1 = DCEI.CreateFrame(hscroll_content)
DCEI.SetFrameSize(frame1, 100, 100)
DCEI.SetFrameImage(frame1, DCEI.Texture("frame01_blue"))

local frame2 = DCEI.CreateFrame(hscroll_content)
DCEI.SetFrameSize(frame2, 100, 100)
DCEI.SetFrameImage(frame2, DCEI.Texture("frame01_brown"))

local frame3 = DCEI.CreateFrame(hscroll_content)
DCEI.SetFrameSize(frame3, 100, 100)
DCEI.SetFrameImage(frame3, DCEI.Texture("frame01_purple"))

local frame4 = DCEI.CreateFrame(hscroll_content)
DCEI.SetFrameSize(frame4, 100, 100)
DCEI.SetFrameImage(frame4, DCEI.Texture("frame01_grey"))

local frame5 = DCEI.CreateFrame(hscroll_content)
DCEI.SetFrameSize(frame5, 100, 100)
DCEI.SetFrameImage(frame5, DCEI.Texture("frame01_yellow"))

local k1 = 200
local duration = 2
local ease = "Linear"

DCEI.AnimateFrameScrollPosition(hscroll_frame, k1, duration, ease)

Tweener AnimateFrameScrollPosition2D(InGameUILayoutComponent ui, Float2 start, Float2 end, float duration, Ease ease)

Tweener AnimateFrameScrollPosition2D(InGameUILayoutComponent ui, Float2 start, Float2 end, float duration, Ease ease)

Description


Animates a scroll frame's scroll position. This function is for CreateScrollFrame.

Parameters

Example Usage

local scroll_frame = DCEI.CreateScrollFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(scroll_frame, 500, 500)
DCEI.SetFrameImageColor(scroll_frame, {r = 1, g = 0, b = 0, a = 0.3})
DCEI.SetScrollFrameScrollInertia(scroll_frame, false)
local scroll_content = DCEI.GetScrollFrameContent(scroll_frame)

local big_content = DCEI.CreateFrame(scroll_content)
DCEI.SetFrameSize(big_content, 1000, 1000)
DCEI.SetFrameImageColor(big_content, {r = 0, g = 0, b = 1, a = 0.4})

local small_content = DCEI.CreateFrame(scroll_content)
DCEI.SetFrameSize(small_content, 100, 100)
DCEI.SetFrameImageColor(small_content, {r = 0, g = 1, b = 0, a = 0.4})

local k1, k2 = 0, 500
local duration = 2
local ease = "Linear"

DCEI.AnimateFrameScrollPosition2D(scroll_frame, {x = k1, y = k1}, {x = k2, y = k2}, duration, ease)

Tweener AnimateFrameScrollPosition2D(InGameUILayoutComponent ui, Float2 end, float duration, Ease ease)

Tweener AnimateFrameScrollPosition2D(InGameUILayoutComponent ui, Float2 end, float duration, Ease ease)

Description


Animates a scroll frame's scroll position starting from its current value. This function is for CreateScrollFrame.

Parameters

Example Usage

local scroll_frame = DCEI.CreateScrollFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(scroll_frame, 500, 500)
DCEI.SetFrameImageColor(scroll_frame, {r = 1, g = 0, b = 0, a = 0.3})
DCEI.SetScrollFrameScrollInertia(scroll_frame, false)
local scroll_content = DCEI.GetScrollFrameContent(scroll_frame)

local big_content = DCEI.CreateFrame(scroll_content)
DCEI.SetFrameSize(big_content, 1000, 1000)
DCEI.SetFrameImageColor(big_content, {r = 0, g = 0, b = 1, a = 0.4})

local small_content = DCEI.CreateFrame(scroll_content)
DCEI.SetFrameSize(small_content, 100, 100)
DCEI.SetFrameImageColor(small_content, {r = 0, g = 1, b = 0, a = 0.4})

local k1 = 500
local duration = 2
local ease = "Linear"

DCEI.AnimateFrameScrollPosition2D(scroll_frame, {x = k1, y = k1}, duration, ease)

Float2 GetScreenSizeInPixel()

Float2 GetScreenSizeInPixel()

Description


Returns the screen size in pixels.

Example Usage

local screen_size = DCEI.GetScreenSizeInPixel()
DCEI.LogMessage(string.format("Screen X: %f, Screen Y: %f", screen_size.x, screen_size.y))

Float2 GetScreenSafeAreaOffsetInPixel()

Float2 GetScreenSafeAreaOffsetInPixel()

Description


Returns the screen safe area offset in pixels.

Example Usage

local safe_offset = DCEI.GetScreenSafeAreaOffsetInPixel()
DCEI.LogMessage(string.format("Screen safe area offset X: %f, Y: %f", safe_offset.x, safe_offset.y))

Float2 GetScreenSafeAreaSizeInPixel()

Float2 GetScreenSafeAreaSizeInPixel()

Description


Returns the screen safe area in pixels.

Example Usage

local safe_area = DCEI.GetScreenSafeAreaSizeInPixel()
DCEI.LogMessage(string.format("Screen safe area X: %f, Y: %f", safe_area.x, safe_area.y))