- Trigger API Reference\DCEI Functions\Custom UI
- SetSelectedUi
- WaitForUiUpdateToComplete
- GetUiRootFrame
- GetUiCanvasSize
- SetUiSizeMultiplier
- GetUiRootFrameForPlayer
- DestroyFrame
- FrameExists
- GetParentFrame
- CreateFrame
- GetFrameWidth
- GetFrameHeight
- SetFrameUseImageSizeRatio
- SetFrameAlpha
- CreateMaskFrame
- CreateStencilMaskFrame
- CreateHighlightFrame
- CreateCameraFrame
- CreateVStackFrame
- CreateHStackFrame
- CreateGridFrame
- SetGridFrameLeftAlignment
- SetGridFrameRightAlignment
- SetGridFrameHorizontalCenterAlignment
- SetGridFrameTopAlignment
- SetGridFrameBottomAlignment
- SetGridFrameVerticalCenterAlignment
- CreateHScrollFrame
- CreateVScrollFrame
- CreateScrollFrame
- GetFrameIndexInParent
- SetFrameIndexInParent
- GetChildrenFrameCount
- CreateButtonFrame
- CreateTextFrame
- CreateUserInputTextFrame
- CreateInputFrame
- CreateFrameFromXml
- UpdateFrame
- GetFrameState
- GetFrameController
- GetChildFrameById
- GetXmlConstant
- GetXmlFrames
- GetChildrenFramesIdAndFrameType
- IsUiRootFrame
- SetCameraFrameViewportSize
- SetCameraFrameViewportWorldPosition
- SetCameraFrameViewportRotation
- SetGridFrameCellWidth
- SetGridFrameCellHeight
- AnimateCameraFrameViewportWorldPosition
- AnimateCameraFrameViewportRotation
- AnimateCameraFrameOrthographicViewportSize
- SetCameraFrameCullingMask
- SetCameraFrameBackgroundColor
- SetCameraFrameViewportOrthographic
- SetCameraFrameOrthographicViewportSize
- CreateMiniMapFrame
- SetCameraFrameEffectColor
- GetScrollFrameContent
- SetScrollFrameScrollPosition
- GetScrollFrameScrollPosition
- SetScrollFrameScrollPosition2D
- GetScrollFrameScrollPosition2D
- SetScrollFrameScrollInertia
- SetScrollFrameScrollEnable
- SetScrollFrameScrollDecelerationRate
- SetScrollFrameScrollContentAlignment
- SetScrollFrameSnapEnabled
- SetScrollFrameSnapStepSize
- SetScrollFrameSnapStepCount
- SetScrollFrameSnapThreshold
- SetScrollFrameSnapSpeed
- SetTextFrameRtlSupport
- SetTextFrameAlignment
- SetTextFrameWrapping
- SetTextFrameOverflow
- SetTextFrameText
- SetTextFrameTextExpression
- SetTextFrameFontSize
- SetTextFrameFontSizeMin
- SetTextFrameFontSizeMax
- SetTextFrameColor
- SetTextFrameOutline
- SetTextFrameShadow
- SetTextFrameOutlineOutside
- SetTextFrameOutlineColor
- SetTextFrameOutlineWidth
- SetTextFrameOutlineSoftness
- SetTextFrameShadowWidth
- SetTextFrameShadowColor
- SetTextFrameShadowSoftness
- GetInputFrameText
- SetInputFrameText
- SetInputFrameFontSize
- SetInputFrameColor
- SetInputFrameWrapping
- SetInputFramePlaceholder
- SetInputFramePlaceholderFontSize
- SetInputFramePlaceholderColor
- SetInputFramePlaceholderOutline
- SetUserInputTextFrameText
- SetUserInputTextFrameFontSize
- SetUserInputTextFrameColor
- SetUserInputTextFrameWrapping
- SetFrameMinSize
- SetFrameMinWidth
- SetFrameMinHeight
- SetFrameMaxSize
- SetFrameMaxWidth
- SetFrameMaxHeight
- SetFrameSize
- CreateListFrame
- SetListFrameItemName
- SetListFrameItemSize
- SetListFrameItemDataCallback
- SetListFrameItemCount
- RefreshListFrameItems
- CreateSpineFrame
- SetSpineFrameAsset
- GetSpineFrameAnimations
- PlaySpineFrameAnimation
- SetFrameWidth
- SetFrameHeight
- FlipFrameHorizontal
- FlipFrameVertical
- SetFrameMatchParent
- SetFramePadding
- SetFramePaddingLeft
- SetFramePaddingRight
- SetFramePaddingTop
- SetFramePaddingBottom
- SetFrameSpacing
- SetFrameLeftAlignment
- SetFrameRightAlignment
- SetFrameTopAlignment
- SetFrameBottomAlignment
- SetFrameCenterAlignment
- SetFrameLeftAlignmentInParent
- SetFrameRightAlignmentInParent
- SetFrameTopAlignmentInParent
- SetFrameBottomAlignmentInParent
- SetFrameCenterAlignmentInParent
- SetFrameHorizontalOffsetInParent
- SetFrameVerticalOffsetInParent
- SetFrameReverseChildrenFrameOrder
- SetFrameUsingFlexLayout
- IsFrameUsingFlexLayout
- SetFrameFlexDirection
- SetFrameFlexGrow
- SetFrameFlexShrink
- SetFrameFlexWrap
- SetFrameJustifyContent
- SetFrameAlignItems
- SetFrameAlignContent
- SetFrameAlignSelf
- SetFrameMarginLeft
- SetFrameMarginRight
- SetFrameMarginTop
- SetFrameMarginBottom
- SetFrameWidthPercent
- SetFrameHeightPercent
- SetFramePosition
- SetFrameLeft
- SetFrameRight
- SetFrameTop
- SetFrameBottom
- SetFrameAspectRatio
- SetFrameImage
- SetFrameImageExpression
- SetFrameImageGrayScaleExpression
- SetButtonDefaultClickAnimationEnabled
- GetButtonDefaultClickAnimationEnabled
- SetButtonFrameEnableExpression
- SetFrameImageTiled
- SetFramePixelsPerUnitMultiplier
- SetFrameImageFillAmount
- GetFrameImageFillAmount
- SetFrameImageFillHorizontal
- SetFrameImageFillVertical
- SetFrameImageFillRadial
- SetFrameImageFillOrigin
- SetFrameImageFillAmountExpression
- SetFrameWidthExpression
- SetFrameHeightExpression
- SetFrameImageColor
- SetFrameImageColorExpression
- SetFrameImageGrayScale
- SetFrameTooltipText
- SetFrameTooltipOffset
- SetFrameTooltipStyle
- SetFrameTooltipPosition
- SetFrameTooltipImage
- SetFrameTooltipFontSize
- SetFrameTooltipPadding
- SetFrameTooltipMaxWidth
- SetFrameTooltipTextColor
- SetButtonFrameClickSound
- SetButtonFrameEnable
- SetButtonFrameDisabledImage
- SetFrameRotation
- SetFrameRotation3D
- BindUnitData
- BindLuaTable
- IsFrameActive
- SetFrameActive
- SetFrameBlockInput
- AttachFrameToUnit
- SetMouseCursorFrame
- SetMouseCursorFrameForPlayer
- AttachOffscreenUnitIndicatorFrame
- SetOffscreenUnitIndicatorFrameCanvasOffset
- MoveFrameToTop
- MoveFrameToBottom
- SetPauseButtonFrame
- SetPauseMenuFrame
- ShowPauseMenuFrame
- HidePauseMenuFrame
- SetPauseMenuFrameMusicButton
- SetPauseMenuFrameSoundButton
- SetPauseMenuFrameResumeButton
- SetPauseMenuFrameQuitButton
- SetPauseMenuFrameRestartButton
- SetPauseMenuFramePlayLevelButton
- SuppressPauseMenuOnApplicationPause
- GetFrameCanvasPosition3D
- GetCanvasPositionFromWorldPosition
- GetWorldPositionFromCanvasPosition
- MoveFrameToCanvasPosition
- SetFrameAnimationLoops
- StopFrameAnimation
- PauseFrameAnimation
- ResumeFrameAnimation
- SetFrameAnimationSpeed
- AnimateFrameImageColor
- AnimateFrameImageColor
- AnimateTextFrameColor
- AnimateTextFrameColor
- AnimateFrameScale
- AnimateFrameScale
- AnimateFrameImageFillAmount
- AnimateFrameImageFillAmount
- AnimateFrameRotation
- AnimateFrameRotation
- AnimateFrameAlpha
- AnimateFrameAlpha
- AnimateFrameHorizontalOffset
- AnimateFrameHorizontalOffset
- AnimateFrameVerticalOffset
- AnimateFrameVerticalOffset
- AnimateFrameScrollPosition
- AnimateFrameScrollPosition
- AnimateFrameScrollPosition2D
- AnimateFrameScrollPosition2D
- GetScreenSizeInPixel
- GetScreenSafeAreaOffsetInPixel
- GetScreenSafeAreaSizeInPixel
Trigger API Reference\DCEI Functions\Custom UI
- UI frames will either have a default size of 0 and expand to fit any children or attempt to fill their parent.
- Placing a frame that attempts to fill its parent inside a frame with a default size of 0 will cause the parent frame to expand to fill their parent.
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
- InGameUILayoutComponent
ui
the UI frame to select.
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
- TypedCallback
callback
the callback function that is called when the event is triggered.
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
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
Parameters
- bool
ignoreSafeArea
if true, ignores any safe areas.
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
- float
multiplier
the global multiplier to apply to all custom UI.
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
- int
player
the player to return the root UI frame for.
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
- InGameUILayoutComponent
ui
the UI frame to destroy.
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
- InGameUILayoutComponent
ui
the UI frame to check.
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
- InGameUILayoutComponent
item
the UI frame to return the parent frame of.
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
- InGameUILayoutComponent
parent
the parent frame.
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
- InGameUILayoutComponent
ui
the UI frame.
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
- InGameUILayoutComponent
ui
the UI frame.
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
- InGameUILayoutComponent
ui
the UI frame. - float
ratio
the image size ratio.
Example Usage
local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameImage(frame, DCEI.Texture("airship_onMap"))
DCEI.SetFrameUseImageSizeRatio(frame, 2)
Related
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
- InGameUILayoutComponent
ui
the UI frame. - float
alpha
the frame transparency, from 0 to 1, where 0 is transparent and 1 is opaque.
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
- InGameUILayoutComponent
parent
the parent frame.
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)
Related
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
- InGameUILayoutComponent
parent
the parent frame.
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)
Related
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
- InGameUILayoutComponent
parent
the parent frame.
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
- InGameUILayoutComponent
parent
the parent frame.
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)
Related
- SetCameraFrameViewportSize
- SetCameraFrameViewportWorldPosition
- SetCameraFrameViewportRotation
- AnimateCameraFrameViewportWorldPosition
- AnimateCameraFrameViewportRotation
- AnimateCameraFrameOrthographicViewportSize
- SetCameraFrameCullingMask
- SetCameraFrameBackgroundColor
- SetCameraFrameViewportOrthographic
- SetCameraFrameOrthographicViewportSize
- CreateMiniMapFrame
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
- InGameUILayoutComponent
parent
the parent frame.
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})
Related
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
- InGameUILayoutComponent
parent
the parent frame.
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})
Related
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
- InGameUILayoutComponent
parent
the parent frame.
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)
Related
- SetGridFrameCellHeight
- SetGridFrameCellWidth
- SetFrameReverseChildrenFrameOrder
- SetFrameSpacing
- GetFrameIndexInParent
- SetFrameIndexInParent
void SetGridFrameLeftAlignment(InGameUILayoutComponent ui)
void SetGridFrameLeftAlignment(InGameUILayoutComponent ui)
Description
Sets left alignment for a UI frame's contents.
Parameters
- InGameUILayoutComponent
ui
the frame to set content alignment for.
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
- InGameUILayoutComponent
ui
the frame to set content alignment for.
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
- InGameUILayoutComponent
ui
the frame to set content alignment for.
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
- InGameUILayoutComponent
ui
the frame to set content alignment for.
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
- InGameUILayoutComponent
ui
the frame to set content alignment for.
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
- InGameUILayoutComponent
ui
the frame to set content alignment for.
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
- InGameUILayoutComponent
parent
the parent frame.
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"))
Related
- CreateHStackFrame
- GetScrollFrameContent
- SetScrollFrameScrollPosition
- GetScrollFrameScrollPosition
- SetScrollFrameScrollInertia
- SetScrollFrameScrollEnable()
- SetScrollFrameScrollDecelerationRate
- SetScrollFrameScrollContentAlignment
- AnimateFrameScrollPosition
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
- InGameUILayoutComponent
parent
the parent frame.
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"))
Related
- CreateVStackFrame
- GetScrollFrameContent
- SetScrollFrameScrollPosition
- GetScrollFrameScrollPosition
- SetScrollFrameScrollInertia
- SetScrollFrameScrollEnable()
- SetScrollFrameScrollDecelerationRate
- SetScrollFrameScrollContentAlignment
- AnimateFrameScrollPosition
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
- InGameUILayoutComponent
parent
the parent frame.
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})
Related
- GetScrollFrameContent
- SetScrollFrameScrollPosition2D
- GetScrollFrameScrollPosition2D
- SetScrollFrameScrollInertia
- SetScrollFrameScrollEnable()
- SetScrollFrameScrollDecelerationRate
- SetScrollFrameScrollContentAlignment
- AnimateFrameScrollPosition2D
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
- InGameUILayoutComponent
item
the UI frame to return the child index of.
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
- InGameUILayoutComponent
item
the UI frame to set the child index of. - int
index
the new child index.
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
- InGameUILayoutComponent
parent
the UI frame to get the child frame count for. This can be called on the main scroll frame to get the number of child frames attached to its content frame.
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
- InGameUILayoutComponent
parent
the parent UI frame.
Example Usage
local button = DCEI.CreateButtonFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(button, 120, 50)
Related
- SetButtonFrameEnableExpression
- SetOnDownCallback
- SetOnUpCallback
- SetOnClickCallback
- SetButtonFrameClickSound
- SetPauseButtonFrame
- SetPauseMenuFrameResumeButton()
- SetPauseMenuFrameQuitButton()
- SetPauseMenuFrameRestartButton()
- SetPauseMenuFramePlayLevelButton()
- SetPauseMenuFrameSettingsButton()
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
- InGameUILayoutComponent
parent
the parent UI frame.
Example Usage
local text = DCEI.CreateTextFrame(button)
DCEI.SetTextFrameText(text, "Button")
Related
- SetTextFrameRtlSupport
- SetTextFrameAlignment
- SetTextFrameWrapping
- SetTextFrameOverflow
- SetTextFrameText
- SetTextFrameTextExpression
- SetTextFrameFontSize
- SetTextFrameFontSizeMin
- SetTextFrameFontSizeMax
- SetTextFrameColor
- SetTextFrameOutline
- SetTextFrameShadow
- SetTextFrameOutlineOutside
- SetTextFrameOutlineColor
- SetTextFrameOutlineWidth
- SetTextFrameOutlineSoftness
- SetTextFrameShadowWidth
- SetTextFrameShadowColor
- SetTextFrameShadowSoftness
- SetTextFrameShadowDirection
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
- InGameUILayoutComponent
parent
the parent UI frame.
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")
Related
- SetUserInputTextFrameText
- SetUserInputTextFrameFontSize
- SetUserInputTextFrameColor
- SetUserInputTextFrameWrapping
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
- InGameUILayoutComponent
parent
the parent UI frame.
Example Usage
local input = DCEI.CreateInputFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(input, 300, 50)
Related
- GetInputFrameText
- SetInputFrameText()
- SetInputFrameFontSize
- SetInputFrameColor
- SetInputFrameWrapping
- SetInputFramePlaceholder
- SetInputFramePlaceholderFontSize
- SetInputFramePlaceholderColor
- SetInputFramePlaceholderOutline
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
- InGameUILayoutComponent
parent
the parent UI frame. - string
name
the name of the XML UI element to create the UI from.
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
Related
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
- InGameUILayoutComponent
ui
the UI frame to update. - object
callback
the callback function to run.
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
- InGameUILayoutComponent
ui
the UI frame to get the state of.
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
- InGameUILayoutComponent
ui
the UI frame to get the controller of.
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
- InGameUILayoutComponent
ui
the parent XML UI frame. - string
id
the type of the child UI frame.
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
- string
name
name of the XML UI data constant.
Example Usage
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
- InGameUILayoutComponent
ui
the parent XML UI frame.
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
- InGameUILayoutComponent
ui
the XMl UI frame to check.
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
- InGameUILayoutComponent
ui
the camera frame UI to set the size of. - int
x
the X resolution. - int
y
the Y resolution. - bool
discardDepth
if true, discards the camera depth. This parameter is optional, and defaults to false.
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
)
Related
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
- InGameUILayoutComponent
ui
the camera frame UI to set the size of. - float
x
the new X coordinate. - float
y
the new Y coordinate. - float
z
the new Z coordinate.
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
)
Related
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
- InGameUILayoutComponent
ui
the camera frame UI to set the rotation of. - float
x
the rotation about the X axis in degrees. A value of 180 will make the camera face backwards and be flipped vertically. - float
y
the rotation about the Y axis in degrees. A value of 180 will make the camera face backwards. - float
z
the rotation about the Z axis rotation in degrees. A value of 180 will make the camera be flipped vertically.
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
)
Related
void SetGridFrameCellWidth(InGameUILayoutComponent ui, float width)
void SetGridFrameCellWidth(InGameUILayoutComponent ui, float width)
Description
Sets the cell width for a grid.
Parameters
- InGameUILayoutComponent
ui
the grid UI frame. - float
width
the width of a grid cell.
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)
Related
void SetGridFrameCellHeight(InGameUILayoutComponent ui, float height)
void SetGridFrameCellHeight(InGameUILayoutComponent ui, float height)
Description
Sets the cell height for a grid.
Parameters
- InGameUILayoutComponent
ui
the grid UI frame. - float
height
the height of a grid cell.
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)
Related
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
- InGameUILayoutComponent
ui
the camera frame UI to set the size of. - float
x
the new X coordinate. - float
y
the new Y coordinate. - float
z
the new Z coordinate. - float
duration
the duration of the camera frame animation. A duration of 0 will make the animation instant. - Ease
ease
the easing function to use for the animation. See https://easings.net/en for examples.
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
- InGameUILayoutComponent
ui
the camera frame UI to set the size of. - float
x
the new X coordinate. - float
y
the new Y coordinate. - float
z
the new Z coordinate. - float
duration
the duration of the camera frame animation. A duration of 0 will make the animation instant. - Ease
ease
the easing function to use for the animation. See https://easings.net/en for examples.
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
- InGameUILayoutComponent
ui
the camera frame UI to set the rotation of. - float
size
the new orthographic size. - float
duration
the duration of the camera frame animation. A duration of 0 will make the animation instant. - Ease
ease
the easing function to use for the animation. See https://easings.net/en for examples.
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")
Related
- CreateCameraFrame
- SetFrameAnimationLoops
- StopFrameAnimation
- SetCameraFrameViewportOrthographic
- SetCameraFrameOrthographicViewportSize
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
- InGameUILayoutComponent
ui
the camera frame. - int
mask
the culling mask to apply. Odd values will remove the terrain, even values will remove everything.
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)
Related
void SetCameraFrameBackgroundColor(InGameUILayoutComponent ui, ColorRGBA color)
void SetCameraFrameBackgroundColor(InGameUILayoutComponent ui, ColorRGBA color)
Description
Set background color for a camera frame.
Parameters
- InGameUILayoutComponent
ui
the camera frame. - ColorRGBA
color
the RGBA values. Also accepts hex codes, such as"#32a852"
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
- InGameUILayoutComponent
ui
the camera frame. - bool
set
if true, enables orthographic view.
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)
Related
void SetCameraFrameOrthographicViewportSize(InGameUILayoutComponent ui, float size)
void SetCameraFrameOrthographicViewportSize(InGameUILayoutComponent ui, float size)
Description
Sets the orthographic size for a camera frame.
Parameters
- InGameUILayoutComponent
ui
the camera frame. - float
size
the orthographic size.
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
)
Related
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
- InGameUILayoutComponent
parent
the parent frame. - bool
hideTerrain
if true, hides the terrain.
Example Usage
local minimap = DCEI.CreateMiniMapFrame(DCEI.GetUiRootFrame(), false)
DCEI.SetCameraFrameViewportSize(minimap, 500, 500)
DCEI.SetFrameSize(minimap, 200, 200)
Related
- SetCameraFrameViewportSize
- SetCameraFrameViewportWorldPosition
- SetCameraFrameViewportRotation
- AnimateCameraFrameViewportWorldPosition
- AnimateCameraFrameViewportRotation
- AnimateCameraFrameOrthographicViewportSize
- SetCameraFrameCullingMask
- SetCameraFrameBackgroundColor
- SetCameraFrameViewportOrthographic
- SetCameraFrameOrthographicViewportSize
- CreateMiniMapFrame
- Unit Mini Map Config
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
- InGameUILayoutComponent
ui
the camera frame. - ColorRGB
color
the RGB values. Also accepts hex values such as"#32a852"
- float
saturation
the saturation of color effect. - float
contrast
the contrast of color effect. - float
brightness
the brightness of color effect.
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
- InGameUILayoutComponent
parent
the scroll frame.
Example Usage
local scroll = DCEI.CreateScrollFrame(DCEI.GetUiRootFrame())
local content = DCEI.GetScrollFrameContent(scroll)
Related
void SetScrollFrameScrollPosition(InGameUILayoutComponent ui, float position)
void SetScrollFrameScrollPosition(InGameUILayoutComponent ui, float position)
Description
Sets the scroll position for an CreateHScrollFrame or CreateVScrollFrame frames.
Parameters
- InGameUILayoutComponent
ui
the scroll frame (not the scroll content frame). - float
position
the offset to set the scroll to.
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})
Related
float GetScrollFrameScrollPosition(InGameUILayoutComponent ui)
float GetScrollFrameScrollPosition(InGameUILayoutComponent ui)
Description
Returns the position of a scroll frame.
Parameters
- InGameUILayoutComponent
ui
the scroll frame (not the scroll content frame).
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)
Related
void SetScrollFrameScrollPosition2D(InGameUILayoutComponent ui, Float2 position)
void SetScrollFrameScrollPosition2D(InGameUILayoutComponent ui, Float2 position)
Description
Sets the position of a CreateScrollFrame frame.
Parameters
- InGameUILayoutComponent
ui
the scroll frame (not the scroll content frame). - Float2
position
the new scroll position.
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})
Related
Float2 GetScrollFrameScrollPosition2D(InGameUILayoutComponent ui)
Float2 GetScrollFrameScrollPosition2D(InGameUILayoutComponent ui)
Description
Returns the position of a CreateScrollFrame frame.
Parameters
- InGameUILayoutComponent
ui
the scroll frame (not the scroll content frame).
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)
Related
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
- InGameUILayoutComponent
ui
the scroll frame (not the scroll content frame). - bool
value
if true, the frame's content will decelerate instead of stopping when scrolling stops. This is true by default for newly created scroll frames.
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})
Related
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
- InGameUILayoutComponent
ui
the scroll frame (not the scroll content frame). - bool
value
if true, enables scrolling for the scroll element. This is true by default for newly created scroll frames.
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})
Related
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
- InGameUILayoutComponent
ui
the scroll frame (not the scroll content frame). - float
value
the scroll deceleration rate.
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})
Related
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
- InGameUILayoutComponent
ui
the scroll frame (not the scroll content frame). - string
value
the alignment. Possible values: HScroll:left (default), right
VScroll:top (default), bottom
Scroll:left, right, top, bottom, (top|bottom)-(left|right)
Example Usage
local vscroll_frame = DCEI.CreateVScrollFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(vscroll_frame, 200, 500)
DCEI.SetScrollFrameScrollContentAlignment(vscroll_frame, "right")
Related
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
- InGameUILayoutComponent
ui
the scroll frame (not the scroll content frame). - bool
value
set scroll frame snapping to true or false.
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
- InGameUILayoutComponent
ui
the scroll frame (not the scroll content frame). - float
value
sets the step size for the snapping behavior, e.g. width of snapping steps.
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
- InGameUILayoutComponent
ui
the scroll frame (not the scroll content frame). - int
value
the number of steps the frame can snap to.
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
- InGameUILayoutComponent
ui
the scroll frame (not the scroll content frame). - float
value
this sets the threshold for how close to the next step will cause the snapping to occur. If set to half of the step width, for an example, scrolling halfway to the next step will result in snapping to that step.
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
- InGameUILayoutComponent
ui
the scroll frame (not the scroll content frame). - float
value
how fast the scroll will snap to the next step.
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
- InGameUILayoutComponent
text
the text frame. - bool
value
if true, enables RTL support.
Example Usage
local text_frame = DCEI.CreateTextFrame(DCEI.GetUiRootFrame())
DCEI.SetTextFrameRtlSupport(text_frame, false)
Related
void SetTextFrameAlignment(InGameUILayoutComponent text, string alignment)
void SetTextFrameAlignment(InGameUILayoutComponent text, string alignment)
Description
Sets the text alignment for a text frame.
Parameters
- InGameUILayoutComponent
text
the text frame. - string
alignment
the text alignment. Possible values:start, end, top, bottom, (top|bottom)-(start|end)
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")
Related
void SetTextFrameWrapping(InGameUILayoutComponent text, bool enable)
void SetTextFrameWrapping(InGameUILayoutComponent text, bool enable)
Description
Sets text wrapping for a text frame.
Parameters
- InGameUILayoutComponent
text
the text frame. - bool
enable
if true, enables text wrapping. This is true by default for newly created text frames.
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)
Related
void SetTextFrameOverflow(InGameUILayoutComponent text, bool enable)
void SetTextFrameOverflow(InGameUILayoutComponent text, bool enable)
Description
Sets text overflow for a text frame.
Parameters
- InGameUILayoutComponent
text
the text frame. - bool
enable
if true, enables text overflow. This is true by default for newly created text frames.
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)
Related
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
- InGameUILayoutComponent
text
the text frame to set the text of. - string
content
the text to set. Supports rich text.Supports the following parameters from bound units:
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)
Related
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.
- For more information, see the notion guide on Data Binding.
Parameters
- InGameUILayoutComponent
text
the text frame to set the text of. - string
content
the text to set. See Data-Binding.
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}")
Related
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
- InGameUILayoutComponent
text
the text frame. - float
size
the new text size.
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)
Related
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
- InGameUILayoutComponent
text
the text frame. - float
size
the new minimum text size.
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)
Related
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
- InGameUILayoutComponent
text
the text frame. - float
size
the new maximum text size.
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)
Related
void SetTextFrameColor(InGameUILayoutComponent text, ColorRGB color)
void SetTextFrameColor(InGameUILayoutComponent text, ColorRGB color)
Description
Sets the color of text for a text frame.
Parameters
- InGameUILayoutComponent
text
the text frame. - ColorRGB
color
the RGB values for the line. Also accepts hex values such as"#32a852"
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
- InGameUILayoutComponent
text
the text frame. - bool
outline
if true, enables the text outline. This is true by default for newly created text frames.
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)
Related
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
- InGameUILayoutComponent
text
the text frame. - bool
enableShadow
if true, enables the text shadow. This is true by default for newly created text frames.
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)
Related
void SetTextFrameOutlineOutside(InGameUILayoutComponent text, bool outside)
void SetTextFrameOutlineOutside(InGameUILayoutComponent text, bool outside)
Description
Sets the outline for a text frame's text.
Parameters
- InGameUILayoutComponent
text
the text frame. - bool
outside
if true, enables the text's outside outline. This is false by default for newly created text frames.
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)
Related
void SetTextFrameOutlineColor(InGameUILayoutComponent text, ColorRGBA color)
void SetTextFrameOutlineColor(InGameUILayoutComponent text, ColorRGBA color)
Description
Sets the outline color for a text frame's text.
Parameters
- InGameUILayoutComponent
text
the text frame. - ColorRGBA
color
the RGBA values for the line. Also accepts hex codes, such as"#32a852"
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})
Related
void SetTextFrameOutlineWidth(InGameUILayoutComponent text, float width)
void SetTextFrameOutlineWidth(InGameUILayoutComponent text, float width)
Description
Sets the width for a text frame's text outline.
Parameters
- InGameUILayoutComponent
text
the text frame. - float
width
the width of the outline, scaled from 0-1. A value less than 0 will disable the outline.
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)
Related
void SetTextFrameOutlineSoftness(InGameUILayoutComponent text, float softness)
void SetTextFrameOutlineSoftness(InGameUILayoutComponent text, float softness)
Description
Set the softness for a text frame's text outline.
Parameters
- InGameUILayoutComponent
text
the text frame. - float
softness
the softness of the outline, scaled from 0-1.
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)
Related
void SetTextFrameShadowWidth(InGameUILayoutComponent text, float width)
void SetTextFrameShadowWidth(InGameUILayoutComponent text, float width)
Description
Sets the width for a text frame's text shadow.
Parameters
- InGameUILayoutComponent
text
the text frame. - float
width
the width of the shadow, scaled from 0-1. A value less than 0 will remove the shadow without removing the outline.
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)
Related
void SetTextFrameShadowColor(InGameUILayoutComponent text, ColorRGBA color)
void SetTextFrameShadowColor(InGameUILayoutComponent text, ColorRGBA color)
Description
- Transform
text
the text frame. - ColorRGBA
color
the RGBA values for the line. Also accepts hex codes, such as"#32a852"
Parameters
- InGameUILayoutComponent
text
the text frame. - ColorRGBA
color
the RGBA values for the line. Also accepts hex codes, such as"#32a852"
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})
Related
void SetTextFrameShadowSoftness(InGameUILayoutComponent text, float softness)
void SetTextFrameShadowSoftness(InGameUILayoutComponent text, float softness)
Description
Set the softness for a text frame's text shadow.
Parameters
- InGameUILayoutComponent
text
the text frame. - float
softness
the softness of the shadow, scaled from 0-1.
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)
Related
string GetInputFrameText(InGameUILayoutComponent text)
string GetInputFrameText(InGameUILayoutComponent text)
Description
Returns the text entered into an input text frame.
Parameters
- InGameUILayoutComponent
text
the input frame.
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)
Related
void SetInputFrameText(InGameUILayoutComponent text, string content)
void SetInputFrameText(InGameUILayoutComponent text, string content)
Description
Sets the text for an input frame.
Parameters
- InGameUILayoutComponent
text
the input frame. - string
content
the text to set.
Example Usage
local input_frame = DCEI.CreateInputFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(input_frame, 100, 50)
DCEI.SetInputFrameText(input_frame, "Input Frame")
Related
void SetInputFrameFontSize(InGameUILayoutComponent text, float size)
void SetInputFrameFontSize(InGameUILayoutComponent text, float size)
Description
Sets the text size for an input frame.
Parameters
- InGameUILayoutComponent
text
the input frame. - float
size
the new text size.
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)
Related
void SetInputFrameColor(InGameUILayoutComponent text, ColorRGB color)
void SetInputFrameColor(InGameUILayoutComponent text, ColorRGB color)
Description
Sets the text color for an input frame.
Parameters
- InGameUILayoutComponent
text
the input frame. - ColorRGB
color
the RGB values for the line. Also accepts hex values such as"#32a852"
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})
Related
void SetInputFrameWrapping(InGameUILayoutComponent text, bool enable)
void SetInputFrameWrapping(InGameUILayoutComponent text, bool enable)
Description
Sets text wrapping for an input frame.
Parameters
- InGameUILayoutComponent
text
the input frame. - bool
enable
if true, enables text wrapping. This is false by default for newly created input frames.
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)
Related
void SetInputFramePlaceholder(InGameUILayoutComponent text, string content)
void SetInputFramePlaceholder(InGameUILayoutComponent text, string content)
Description
Sets the text placeholder for an input frame.
Parameters
- InGameUILayoutComponent
text
the input frame. - string
content
the text placeholder to set.
Example Usage
local input_frame = DCEI.CreateInputFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(input_frame, 100, 50)
DCEI.SetInputFramePlaceholder(input_frame, "Edit me")
Related
void SetInputFramePlaceholderFontSize(InGameUILayoutComponent text, float size)
void SetInputFramePlaceholderFontSize(InGameUILayoutComponent text, float size)
Description
Sets the placeholder text size for an input frame.
Parameters
- InGameUILayoutComponent
text
the input frame. - float
size
the font size.
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)
Related
void SetInputFramePlaceholderColor(InGameUILayoutComponent text, ColorRGB color)
void SetInputFramePlaceholderColor(InGameUILayoutComponent text, ColorRGB color)
Description
Sets the text placeholder's color for an input frame.
Parameters
- InGameUILayoutComponent
text
the text frame. - ColorRGB
color
the RGB values for the line. Also accepts hex values such as"#32a852"
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})
Related
void SetInputFramePlaceholderOutline(InGameUILayoutComponent text, bool outline)
void SetInputFramePlaceholderOutline(InGameUILayoutComponent text, bool outline)
Description
Sets the text placeholder's outline for an input frame.
Parameters
- InGameUILayoutComponent
text
the input frame. - bool
outline
if true, displays the outline. This is false by default for newly created input frames.
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)
Related
void SetUserInputTextFrameText(InGameUILayoutComponent text, string content)
void SetUserInputTextFrameText(InGameUILayoutComponent text, string content)
Description
Sets the text for a user input text frame.
Parameters
- InGameUILayoutComponent
text
the user input text frame. - string
content
the text to set.
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)
Related
void SetUserInputTextFrameFontSize(InGameUILayoutComponent text, float size)
void SetUserInputTextFrameFontSize(InGameUILayoutComponent text, float size)
Description
Sets the text size for a user input text frame.
Parameters
- InGameUILayoutComponent
text
the user input text frame. - float
size
the new text size.
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)
Related
void SetUserInputTextFrameColor(InGameUILayoutComponent text, ColorRGB color)
void SetUserInputTextFrameColor(InGameUILayoutComponent text, ColorRGB color)
Description
Sets the text color for a user input text frame.
Parameters
- InGameUILayoutComponent
text
the text frame. - ColorRGB
color
the RGB values for the line. Also accepts hex values such as"#32a852"
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})
Related
void SetUserInputTextFrameWrapping(InGameUILayoutComponent text, bool enable)
void SetUserInputTextFrameWrapping(InGameUILayoutComponent text, bool enable)
Description
Sets text wrapping for a user input text frame.
Parameters
- InGameUILayoutComponent
text
the input frame. - bool
enable
if true, enables text wrapping. This is false by default for newly created user input text frames.
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)
Related
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
- InGameUILayoutComponent
ui
the frame to adjust. - float
width
the new minimum width of the frame. - float
height
the new minimum height of the frame.
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
- InGameUILayoutComponent
ui
the frame to adjust. - float
width
the new minimum width of the frame.
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
- InGameUILayoutComponent
ui
the frame to adjust. - float
height
the new minimum height of the frame.
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
- InGameUILayoutComponent
ui
the frame to adjust. - float
width
the new maximum width of the frame. - float
height
the new maximum height of the frame.
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
- InGameUILayoutComponent
ui
the frame to adjust. - float
width
the new maximum width of the frame.
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
- InGameUILayoutComponent
ui
the frame to adjust. - float
height
the new maximum height of the frame.
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
- InGameUILayoutComponent
ui
the frame to adjust. - float
width
the new width of the frame. - float
height
the new height of the frame.
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
- InGameUILayoutComponent
parent
the parent frame.
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
- InGameUILayoutComponent
ui
the virtualized list frame. - string
itemName
the XML name of item frame.
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
- InGameUILayoutComponent
ui
the virtualized list frame. - float
itemSize
the size of item frame.
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
- InGameUILayoutComponent
ui
the virtualized list frame. - TypedCallback<InGameUILayoutComponent, int>
itemDataCallback
the callback function to bind the data to item.
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
- InGameUILayoutComponent
ui
the virtualized list frame. - int
itemCount
the count of list's items.
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
- InGameUILayoutComponent
ui
the virtual list frame to update. - int
startIndex
the index of the first item to be refreshed. - int
endIndex
the index of the last item to be refreshed.
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
- InGameUILayoutComponent
parent
the parent frame under which to create this frame.
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
- InGameUILayoutComponent
ui
the Spine frame to set the asset on. - string
name
the name of the Spine asset to be used.
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
- InGameUILayoutComponent
ui
the Spine frame to get the Spine animations from.
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
- InGameUILayoutComponent
ui
the Spine ui frame. - string
name
the name of the Spine animation. - bool
loop
loop the animation or not. - int
track
which track of the animation to play.
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
- InGameUILayoutComponent
ui
the frame to adjust. - float
width
the new width of the frame.
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
- InGameUILayoutComponent
ui
the frame to adjust. - float
height
the new height of the frame.
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
- InGameUILayoutComponent
ui
the frame to adjust. - bool
matchWidth
whether to set the frame's width to that of its parent. - bool
matchHeight
whether to set the frame's height to that of its parent.
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
- InGameUILayoutComponent
ui
the frame to set padding for. - float
padding
the padding to set.
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
- InGameUILayoutComponent
ui
the frame to set left padding for. - float
padding
the left padding to set.
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
- InGameUILayoutComponent
ui
the frame to set right padding for. - float
padding
the right padding to set.
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
- InGameUILayoutComponent
ui
the frame to set top padding for. - float
padding
the top padding to set.
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
- InGameUILayoutComponent
ui
the frame to set bottom padding for. - float
padding
the bottom padding to set.
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
- InGameUILayoutComponent
ui
the frame to set spacing for. - float
spacing
the spacing to set.
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})
Related
void SetFrameLeftAlignment(InGameUILayoutComponent ui)
void SetFrameLeftAlignment(InGameUILayoutComponent ui)
Description
Sets left alignment for a UI frame's contents.
Parameters
- InGameUILayoutComponent
ui
the frame to set content alignment for.
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
- InGameUILayoutComponent
ui
the frame to set content alignment for.
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
- InGameUILayoutComponent
ui
the frame to set content alignment for.
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
- InGameUILayoutComponent
ui
the frame to set content alignment for.
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
- InGameUILayoutComponent
ui
the frame to set content alignment for.
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
- InGameUILayoutComponent
ui
the frame to set alignment for.
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
- InGameUILayoutComponent
ui
the frame to set alignment for.
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
- InGameUILayoutComponent
ui
the frame to set alignment for.
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
- InGameUILayoutComponent
ui
the frame to set alignment for.
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
- InGameUILayoutComponent
ui
the frame to set alignment for.
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
- InGameUILayoutComponent
ui
the frame to set the offset for. - float
value
the offset distance.
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
- InGameUILayoutComponent
ui
the frame to set the offset for. - float
value
the offset distance.
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
- InGameUILayoutComponent
ui
the frame to reverse the layout order for. - bool
value
if true, reverses the layout order.
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
)
Related
void SetFrameUsingFlexLayout(InGameUILayoutComponent ui)
void SetFrameUsingFlexLayout(InGameUILayoutComponent ui)
Description
Sets a custom UI frame to use flex layout.
Parameters
- InGameUILayoutComponent
ui
the UI frame to use flex layout.
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
- InGameUILayoutComponent
ui
the frame to check if using flex layout rather than legacy layout.
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
- InGameUILayoutComponent
ui
the frame to set the flexDirection attribute on. - YogaFlexDirection
direction
the flexDirection value to set. Values:column, column-reverse, row, row-reverse
Example Usage
<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
- InGameUILayoutComponent
ui
the frame to set the flexGrow attribute on. - float
grow
what percent of availible space the frame can grow to fit.
Example Usage
<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
- InGameUILayoutComponent
ui
the frame to set the flexShrink attribute on. - float
shrink
what percent of availible space the frame can grow to fit.
Example Usage
<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
- InGameUILayoutComponent
ui
the frame to set the flexWrap attribute on. - YogaWrap
wrap
the type of wrapping to use:wrap, wrap-reverse, no-wrap
Example Usage
<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
- InGameUILayoutComponent
ui
the frame to set the justifyContent attribute on. - YogaJustify
justifyContent
the type of justification to use
Example Usage
<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
- InGameUILayoutComponent
ui
the frame to set the alignItems attribute on. - YogaAlign
alignItems
the type of justification to use:baseline, center, flex-end, flex-start, stretch
Example Usage
<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
- InGameUILayoutComponent
ui
the frame to set the alignContent attribute on. - YogaAlign
alignContent
the type of justification to use:baseline, center, flex-end, flex-start, stretch
Example Usage
<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
- InGameUILayoutComponent
ui
the frame to set the alignSelf attribute on. - YogaAlign
alignSelf
the type of justification to use:baseline, center, flex-end, flex-start, stretch
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
- InGameUILayoutComponent
ui
the frame to set the marginLeft attribute on. - float
marginLeft
the amount of left margin
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
- InGameUILayoutComponent
ui
the frame to set the marginRight attribute on. - float
marginRight
the amount of right margin
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
- InGameUILayoutComponent
ui
the frame to set the marginTop attribute on. - float
marginTop
the amount of top margin
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
- InGameUILayoutComponent
ui
the frame to set the marginBottom attribute on. - float
marginBottom
the amount of bottom margin
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
- InGameUILayoutComponent
ui
the frame to set the widthPercent attribute on. - float
widthPercent
a frame's width as a percentage of it's parent's width
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
- InGameUILayoutComponent
ui
the frame to set the heightPercent attribute on. - float
heightPercent
a frame's height as a percentage of it's parent's height
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
- InGameUILayoutComponent
ui
the frame to set the position attribute on. - YogaPositionType
position
positionRelative
orAbsolute
.
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
- InGameUILayoutComponent
ui
the frame to set the position attribute on. - float
left
left position offset amount
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
- InGameUILayoutComponent
ui
the frame to set the position attribute on. - float
right
right position offset amount
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
- InGameUILayoutComponent
ui
the frame to set the position attribute on. - float
top
top position offset amount
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
- InGameUILayoutComponent
ui
the frame to set the position attribute on. - float
bottom
bottom position offset amount
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
- InGameUILayoutComponent
ui
the frame to set the aspect ratio attribute on. - float
aspectRatio
aspectRatio amount
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
- InGameUILayoutComponent
ui
the frame to set the background image for. - string
name
the image name.
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.
- For more information, see the notion guide on Data Binding.
Parameters
- InGameUILayoutComponent
ui
the frame to set the background image for. - string
expression
the expression.
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")
Related
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.
- For more information, see the notion guide on Data Binding.
Parameters
- InGameUILayoutComponent
ui
the frame to set the background image for. - string
expression
the expression. The expression should evaluate out to a0
or1
, corresponding to afalse
ortrue
, respectively. Does not accepttrue
orfalse
by itself.
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")
Related
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
- InGameUILayoutComponent
ui
the button frame to enable/disable the animation for. - bool
enable
enable animation withtrue
, disable withfalse
.
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
- InGameUILayoutComponent
ui
the button frame to get the enable/disabled on click animation stat for.
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.
- For more information, see the notion guide on Data Binding.
Parameters
- InGameUILayoutComponent
ui
the button to enable. - string
expression
the expression. The expression should evaluate out to a0
or1
, corresponding to afalse
ortrue
, respectively. Does not accepttrue
orfalse
by itself.
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")
Related
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
- Transform
ui
the frame to set the background image for. - bool
setTiled
if true, enables background image tiling (with the original resolution of the background image). This is false by default for newly created frames.
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
- InGameUILayoutComponent
ui
the frame to set the background image for. - bool
setTiled
if true, enables background image tiling (with the original resolution of the background image). This is false by default for newly created frames.
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
- InGameUILayoutComponent
ui
the frame to set the multiplier for. - float
pixelsPerUnitMultiplier
the pixels per unit multiplier.
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)
Related
void SetFrameImageFillAmount(InGameUILayoutComponent ui, float fill)
void SetFrameImageFillAmount(InGameUILayoutComponent ui, float fill)
Description
Sets the fill amount for the background image.
Parameters
- InGameUILayoutComponent
ui
the frame to set the background image fill amount for. - float
fill
the fill amount (between 0 and 1).
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)
Related
- GetFrameImageFillAmount
- SetFrameImageFillHorizontal
- SetFrameImageFillVertical
- SetFrameImageFillRadial
- SetFrameImageFillOrigin
- SetFrameImageFillAmountExpression
- AnimateFrameImageFillAmount
float GetFrameImageFillAmount(InGameUILayoutComponent ui)
float GetFrameImageFillAmount(InGameUILayoutComponent ui)
Description
Returns the background image fill amount.
Parameters
- InGameUILayoutComponent
ui
the frame to get the background image fill amount of.
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)
- SetFrameImageFillAmount
- SetFrameImageFillHorizontal
- SetFrameImageFillVertical
- SetFrameImageFillRadial
- SetFrameImageFillOrigin
- SetFrameImageFillAmountExpression
- AnimateFrameImageFillAmount
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
- InGameUILayoutComponent
ui
the frame to set the background image fill direction for.
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)
- SetFrameImageFillAmount
- GetFrameImageFillAmount
- SetFrameImageFillVertical
- SetFrameImageFillRadial
- SetFrameImageFillOrigin
- SetFrameImageFillAmountExpression
- AnimateFrameImageFillAmount
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
- InGameUILayoutComponent
ui
the frame to set the background image fill direction for.
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)
- SetFrameImageFillAmount
- GetFrameImageFillAmount
- SetFrameImageFillHorizontal
- SetFrameImageFillRadial
- SetFrameImageFillOrigin
- SetFrameImageFillAmountExpression
- AnimateFrameImageFillAmount
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
- InGameUILayoutComponent
ui
the frame to set the background image fill direction for.
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)
- SetFrameImageFillAmount
- GetFrameImageFillAmount
- SetFrameImageFillHorizontal
- SetFrameImageFillVertical
- SetFrameImageFillOrigin
- SetFrameImageFillAmountExpression
- AnimateFrameImageFillAmount
void SetFrameImageFillOrigin(InGameUILayoutComponent ui, int origin)
void SetFrameImageFillOrigin(InGameUILayoutComponent ui, int origin)
Description
Sets the fill progress orientation of a UI frame.
Parameters
- InGameUILayoutComponent
ui
the frame to modify. - int
origin
the fill mode to apply. Accepted values:[0, 1] for horizontal or vertical fills ([left, right] and [bottom, top])
[0, 1, 2, 3] for radial fills ([bottom, right, top, left])
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)
- SetFrameImageFillAmount
- GetFrameImageFillAmount
- SetFrameImageFillHorizontal
- SetFrameImageFillVertical
- SetFrameImageFillRadial
- SetFrameImageFillAmountExpression
- AnimateFrameImageFillAmount
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.
- For more information, see the notion guide on Data Binding.
Parameters
- InGameUILayoutComponent
ui
the frame to set the background image fill amount for. - string
expression
an expression for the fill amount (between 0 and 1). - bool
inverse
if true, inverts the fill amount (does 1-expression).
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)
Related
- BindUnitData
- BindLuaTable
- SetFrameImageFillAmount
- GetFrameImageFillAmount
- SetFrameImageFillHorizontal
- SetFrameImageFillVertical
- SetFrameImageFillRadial
- SetFrameImageFillOrigin
- AnimateFrameImageFillAmount
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.
- For more information, see the notion guide on Data Binding.
Parameters
- InGameUILayoutComponent
ui
the frame to set the width for. - string
expression
an expression for the width.
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")
Related
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.
- For more information, see the notion guide on Data Binding.
Parameters
- InGameUILayoutComponent
ui
the frame to set the height for. - string
expression
an expression for the height.
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")
Related
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
- InGameUILayoutComponent
ui
the frame to tint. - ColorRGBA
color
the RGBA values for the line. Also accepts hex codes, such as"#32a852"
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.
- For more information, see the notion guide on Data Binding.
Parameters
- InGameUILayoutComponent
ui
the frame to tint. - string
r
an expression for the red value of the tint color (between 0 and 1). - string
g
an expression for the green value of the tint color (between 0 and 1). - string
b
an expression for the blue value of the tint color (between 0 and 1). - string
a
an expression for the alpha value of the tint color (between 0 and 1).
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)
Related
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
- InGameUILayoutComponent
ui
the frame to set the background image gray scale for. - bool
isGrayScale
if true, renders the background image in gray scale. The default value is false for newly created frames.
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
- InGameUILayoutComponent
ui
the frame to set the tooltip text for. - string
text
the text of the tooltip.
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")
Related
- SetFrameTooltipOffset
- SetFrameTooltipStyle
- SetFrameTooltipPosition
- SetFrameTooltipImage
- SetFrameTooltipFontSize
- SetFrameTooltipPadding
- SetFrameTooltipMaxWidth
- SetFrameTooltipTextColor
void SetFrameTooltipOffset(int offset)
void SetFrameTooltipOffset(int offset)
Description
Sets the tooltip offset from the cursor. This will affect all tooltips.
Parameters
- int
offset
the offset from the cursor. Negative numbers will cause the tooltip to flicker.
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)
Related
- SetFrameTooltipText()
- SetFrameTooltipStyle
- SetFrameTooltipPosition
- SetFrameTooltipImage
- SetFrameTooltipFontSize
- SetFrameTooltipPadding
- SetFrameTooltipMaxWidth
- SetFrameTooltipTextColor
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
- int
style
the style. A value of0
will display the tooltip next to the cursor (default). A value of1
will display the tooltip next to the frame.
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)
Related
- SetFrameTooltipText()
- SetFrameTooltipOffset
- SetFrameTooltipPosition
- SetFrameTooltipImage
- SetFrameTooltipFontSize
- SetFrameTooltipPadding
- SetFrameTooltipMaxWidth
- SetFrameTooltipTextColor
void SetFrameTooltipPosition(int position)
void SetFrameTooltipPosition(int position)
Description
Sets the tooltip position. This will affect all tooltips.
Parameters
- int
position
the position of the tooltip. A value of0
will display the tooltip to the right of the frame. A value of1
will display the tooltip at the top.
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)
Related
- SetFrameTooltipText()
- SetFrameTooltipOffset
- SetFrameTooltipStyle
- SetFrameTooltipImage
- SetFrameTooltipFontSize
- SetFrameTooltipPadding
- SetFrameTooltipMaxWidth
- SetFrameTooltipTextColor
void SetFrameTooltipImage(string name)
void SetFrameTooltipImage(string name)
Description
Sets a background image for tooltips. This will affect all tooltips.
Parameters
- string
name
the name of the background image.
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"))
Related
- SetFrameTooltipText()
- SetFrameTooltipOffset
- SetFrameTooltipStyle
- SetFrameTooltipPosition
- SetFrameTooltipFontSize
- SetFrameTooltipPadding
- SetFrameTooltipMaxWidth
- SetFrameTooltipTextColor
void SetFrameTooltipFontSize(int size)
void SetFrameTooltipFontSize(int size)
Description
Sets the tooltip font size. This will affect all tooltips.
Parameters
- int
size
the font size.
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)
Related
- SetFrameTooltipText()
- SetFrameTooltipOffset
- SetFrameTooltipStyle
- SetFrameTooltipPosition
- SetFrameTooltipImage
- SetFrameTooltipPadding
- SetFrameTooltipMaxWidth
- SetFrameTooltipTextColor
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
- int
left
the left padding. - int
right
the right padding. - int
top
the top padding. - int
bottom
the bottom padding.
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)
Related
- SetFrameTooltipText()
- SetFrameTooltipOffset
- SetFrameTooltipStyle
- SetFrameTooltipPosition
- SetFrameTooltipImage
- SetFrameTooltipFontSize
- SetFrameTooltipMaxWidth
- SetFrameTooltipTextColor
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
- int
width
the max width.
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)
Related
- SetFrameTooltipText()
- SetFrameTooltipOffset
- SetFrameTooltipStyle
- SetFrameTooltipPosition
- SetFrameTooltipImage
- SetFrameTooltipFontSize
- SetFrameTooltipPadding
- SetFrameTooltipTextColor
void SetFrameTooltipTextColor(ColorRGB color)
void SetFrameTooltipTextColor(ColorRGB color)
Description
Sets the tooltip text color. This will affect all tooltips.
Parameters
- ColorRGB
color
the RGB values for the line. Also accepts hex values such as"#32a852"
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})
Related
- SetFrameTooltipText()
- SetFrameTooltipOffset
- SetFrameTooltipStyle
- SetFrameTooltipPosition
- SetFrameTooltipImage
- SetFrameTooltipFontSize
- SetFrameTooltipPadding
- SetFrameTooltipMaxWidth
void SetButtonFrameClickSound(InGameUILayoutComponent ui, string path)
void SetButtonFrameClickSound(InGameUILayoutComponent ui, string path)
Description
Sets the click sound for the given button.
Parameters
- InGameUILayoutComponent
ui
the button. - string
path
the sound file.
Example Usage
local button = DCEI.CreateButtonFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(button, 100, 100)
DCEI.SetButtonFrameClickSound(button, DCEI.Sound("ancienttree_ability_01"))
Related
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
- InGameUILayoutComponent
ui
the button frame. - bool
enable
if true, enables the button. This is true by default for newly created buttons.
Example Usage
local button = DCEI.CreateButtonFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(button, 100, 100)
DCEI.SetButtonFrameEnable(button, false)
Related
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
- InGameUILayoutComponent
ui
the button frame. - string
name
the name of the background image.
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
- InGameUILayoutComponent
ui
the UI frame to rotate. - float
degrees
the degrees to rotate counterclockwise. Negative values will cause clockwise rotation.
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
- InGameUILayoutComponent
ui
the frame to rotate. - float
x
the angle to rotate the frame in the "x" plane. - float
y
the angle to rotate the frame in the "y" plane. - float
z
the angle to rotate the frame in the "z" plane.
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.
- Accessible data bound values.
- For more information, see the notion guide on Data Binding.
Parameters
- string
name
the string to bind the unit to. - unit
unit
the unit.. Unit attributes list:
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
)
Related
- SetTextFrameTextExpression()
- SetFrameImageExpression()
- SetFrameImageGrayScaleExpression()
- SetButtonFrameEnableExpression()
- SetFrameImageFillAmountExpression()
- SetFrameWidthExpression()
- SetFrameHeightExpression()
- SetFrameImageColorExpression()
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
- string
name
the string to bind the data to. - object
value
the lua table.
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
)
Related
- SetTextFrameTextExpression()
- SetFrameImageExpression()
- SetFrameImageGrayScaleExpression()
- SetButtonFrameEnableExpression()
- SetFrameImageFillAmountExpression()
- SetFrameWidthExpression()
- SetFrameHeightExpression()
- SetFrameImageColorExpression()
bool IsFrameActive(InGameUILayoutComponent ui)
bool IsFrameActive(InGameUILayoutComponent ui)
Description
Returns whether the given UI frame is active.
Parameters
- InGameUILayoutComponent
ui
the UI frame to return the status of.
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))
Related
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
- InGameUILayoutComponent
ui
the UI frame to set the status of. - bool
value
if true, sets the frame to active. Newly created frames are active by default.
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
- InGameUILayoutComponent
ui
the frame to adjust. - bool
value
whether or not the frame blocks input.
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
- InGameUILayoutComponent
ui
the frame to attach. - unit
unit
the unit to attach the frame to. - UnitLabelOptions
options
accepted values - bool
useCurrentUiRoot
(optional) when true, uses the existing UI root for the attached UI layer. Otherwise the attached UI will be rendered beneath UI root.
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
- InGameUILayoutComponent
ui
the frame to attach.
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
- int
player
player id - InGameUILayoutComponent
ui
the frame to attach.
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
- InGameUILayoutComponent
ui
the UI frame to use as an offscreen indicator. - unit
unit
the unit to attach the indicator to. - InGameUILayoutComponent
rotatingPointerChildFrame
(optional) if set, this frame will rotate towards the direction of the offscreen unit.
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
- InGameUILayoutComponent
ui
the UI frame used as an offscreen indicator. - Float2
offset
the offset distance from the screen.
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
- InGameUILayoutComponent
ui
the UI frame to move to the top.
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
- InGameUILayoutComponent
ui
the UI frame to move to the bottom.
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
- InGameUILayoutComponent
ui
the button frame to set as the pause button.
Example Usage
local button = DCEI.CreateButtonFrame(DCEI.GetUiRootFrame())
DCEI.SetFrameSize(button, 100, 100)
DCEI.SetPauseButtonFrame(button)
Related
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
- InGameUILayoutComponent
ui
the UI frame to set as the 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
)
Related
- SetPauseButtonFrame()
- ShowPauseMenuFrame()
- HidePauseMenuFrame()
- SetPauseMenuCallback()
- SetPauseMenuFrameResumeButton()
- SetPauseMenuFrameQuitButton()
- SetPauseMenuFrameRestartButton()
- SetPauseMenuFramePlayLevelButton()
- SetPauseMenuFrameSettingsButton()
- SuppressPauseMenuOnApplicationPause()
void ShowPauseMenuFrame()
void ShowPauseMenuFrame()
Description
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
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
- InGameUILayoutComponent
ui
the target UI.
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
- InGameUILayoutComponent
ui
the target UI.
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
- InGameUILayoutComponent
ui
the button to set as the resume button.
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)
Related
void SetPauseMenuFrameQuitButton(InGameUILayoutComponent ui)
void SetPauseMenuFrameQuitButton(InGameUILayoutComponent ui)
Description
Sets the pause menu quit button. This button will exit the game.
Parameters
- InGameUILayoutComponent
ui
the button to set as the quit button.
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)
Related
void SetPauseMenuFrameRestartButton(InGameUILayoutComponent ui)
void SetPauseMenuFrameRestartButton(InGameUILayoutComponent ui)
Description
Sets the pause menu restart button. This button will restart the game.
Parameters
- InGameUILayoutComponent
ui
the button to set as the restart button.
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)
Related
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
- InGameUILayoutComponent
ui
the button to set as the play level button. - string
path
the level's path. - string
displayName
the name to display for the level.
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)
Related
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
- InGameUILayoutComponent
ui
the button to get the position of.
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
- Float3
worldPosition
the world position
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
- InGameUILayoutComponent
ui
the ui that moves - Float3
canvasPosition
the canvas position - Offset
offset
final offset of the position
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
- Tweener
tweener
the UI animation. - int
loops
the number of loops to play. If loops is set to -1 it will loop infinitely, until stopped with StopFrameAnimation. - LoopType
loopType
the type of loop.
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")
Related
- AnimateCameraFrameViewportWorldPosition
- AnimateCameraFrameViewportRotation
- AnimateCameraFrameOrthographicViewportSize
- AnimateFrameScale
- AnimateFrameImageFillAmount
- AnimateFrameRotation
- AnimateFrameAlpha
- AnimateFrameHorizontalOffset
- AnimateFrameVerticalOffset
- AnimateFrameScrollPosition
- AnimateFrameScrollPosition2D
void StopFrameAnimation(Tweener tweener, bool waitAnimationComplete = False)
void StopFrameAnimation(Tweener tweener, bool waitAnimationComplete = False)
Description
Parameters
- Tweener
tweener
the UI animation. - bool
waitAnimationComplete
if true, it interrupts the animation immediately; if false, it waits for the current loop of the animation to complete.
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
- Tweener
tweener
the UI animation. - float
speed
speed factor applied to the animation.
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
Parameters
InGameUILayoutComponent
ui
which frame to animate.ColorRGBA
start
the initial RGBA values. Also accepts hex codes, such as"#32a852"
ColorRGBA
end
the final RGBA values. Also accepts hex codes, such as"#32a852"
float
duration
the duration of the animation.Ease
ease
the easing function to use for the animation. See https://easings.net/en for examples.
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
- InGameUILayoutComponent
ui
which frame to animate. - ColorRGBA
end
the final RGBA values. Also accepts hex codes, such as"#32a852"
- float
duration
the duration of the animation. - Ease
ease
the easing function to use for the animation. See https://easings.net/en for examples.
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
- InGameUILayoutComponent
ui
which frame to animate. - ColorRGB
start
the initial RGB values. Also accepts hex values such as"#32a852"
- ColorRGB
end
the final RGB values. Also accepts hex values such as"#32a852"
- float
duration
the duration of the animation. - Ease
ease
the easing function to use for the animation. See https://easings.net/en for examples.
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
- InGameUILayoutComponent
ui
which frame to animate. - ColorRGB
end
the final RGB values. Also accepts hex values such as"#32a852"
- float
duration
the duration of the animation. - Ease
ease
the easing function to use for the animation. See https://easings.net/en for examples.
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
- InGameUILayoutComponent
ui
which frame to animate. - Float3
start
the initial scale of the frame animation as{x = 1, y = 1, z = 1}
. - Float3
end
the final scale of the frame animation as{x = 1, y = 1, z = 1}
. - float
duration
the duration of the animation. - Ease
ease
the easing function to use for the animation. See https://easings.net/en for examples.
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)
Related
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
- InGameUILayoutComponent
ui
which frame to animate. - Float3
end
the final scale of the frame animation as{x = 1, y = 1, z = 1}
. - float
duration
the duration of the animation. - Ease
ease
the easing function to use for the animation. See https://easings.net/en for examples.
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
- InGameUILayoutComponent
ui
the UI frame to animate background image fill for. - float
start
the starting fill, from 0-1. - float
end
the ending fill, from 0-1. - float
duration
the duration of the animation. - Ease
ease
the easing function to use for the animation. See https://easings.net/en for examples.
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)
Related
- SetFrameAnimationLoops
- StopFrameAnimation
- SetFrameImageFillAmount
- GetFrameImageFillAmount
- SetFrameImageFillHorizontal
- SetFrameImageFillVertical
- SetFrameImageFillRadial
- SetFrameImageFillOrigin
- SetFrameImageFillAmountExpression
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
- InGameUILayoutComponent
ui
the UI frame to animate background image fill for. - float
end
the ending fill, from 0-1. - float
duration
the duration of the animation. - Ease
ease
the easing function to use for the animation. See https://easings.net/en for examples.
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)
Related
- SetFrameAnimationLoops
- StopFrameAnimation
- SetFrameImageFillAmount
- GetFrameImageFillAmount
- SetFrameImageFillHorizontal
- SetFrameImageFillVertical
- SetFrameImageFillRadial
- SetFrameImageFillOrigin
- SetFrameImageFillAmountExpression
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
- InGameUILayoutComponent
ui
the UI frame to animate the rotation for. - Float3
start
the starting rotation. - Float3
end
the ending rotation. - float
duration
the duration of the animation. - Ease
ease
the easing function to use for the animation. See https://easings.net/en for examples.
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)
Related
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
- InGameUILayoutComponent
ui
the UI frame to animate the rotation for. - Float3
end
the ending rotation. - float
duration
the duration of the animation. - Ease
ease
the easing function to use for the animation. See https://easings.net/en for examples.
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)
Related
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
Parameters
- InGameUILayoutComponent
ui
the UI frame to animate the alpha for. - float
start
the starting alpha, from 0-1. - float
end
the ending alpha, from 0-1. - float
duration
the duration of the animation. - Ease
ease
the easing function to use for the animation. See https://easings.net/en for examples.
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")
Related
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
- InGameUILayoutComponent
ui
the UI frame to animate the alpha for. - float
end
the ending alpha, from 0-1. - float
duration
the duration of the animation. - Ease
ease
the easing function to use for the animation. See https://easings.net/en for examples.
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)
Related
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
- InGameUILayoutComponent
ui
the UI frame to animate the horizontal offset for. - float
start
the starting offset. - float
end
the ending offset. - float
duration
the duration of the animation. - Ease
ease
the easing function to use for the animation. See https://easings.net/en for examples.
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)
Related
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
- InGameUILayoutComponent
ui
the UI frame to animate the horizontal offset for. - float
end
the ending offset. - float
duration
the duration of the animation. - Ease
ease
the easing function to use for the animation. See https://easings.net/en for examples.
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)
Related
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
- InGameUILayoutComponent
ui
the UI frame to animate the vertical offset for. - float
start
the starting offset. - float
end
the ending offset. - float
duration
the duration of the animation. - Ease
ease
the easing function to use for the animation. See https://easings.net/en for examples.
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)
Related
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
- InGameUILayoutComponent
ui
the UI frame to animate the vertical offset for. - float
end
the ending offset. - float
duration
the duration of the animation. - Ease
ease
the easing function to use for the animation. See https://easings.net/en for examples.
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)
Related
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
- InGameUILayoutComponent
ui
the scroll frame to animate the scroll position for. - float
start
the starting position. - float
end
the ending position. - float
duration
the duration of the animation. - Ease
ease
the easing function to use for the animation. See https://easings.net/en for examples.
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)
Related
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
- InGameUILayoutComponent
ui
the scroll frame to animate the scroll position for. - float
end
the ending position. - float
duration
the duration of the animation. - Ease
ease
the easing function to use for the animation. See https://easings.net/en for examples.
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)
Related
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
- InGameUILayoutComponent
ui
the scroll frame to animate the scroll position for. - Float2
start
the starting position. - Float2
end
the ending position. - float
duration
the duration of the animation. - Ease
ease
the easing function to use for the animation. See https://easings.net/en for examples.
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)
Related
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
- InGameUILayoutComponent
ui
the scroll frame to animate the scroll position for. - Float2
end
the ending position. - float
duration
the duration of the animation. - Ease
ease
the easing function to use for the animation. See https://easings.net/en for examples.
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)
Related
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))