Trigger API Reference DCEI Functions Custom UI1 - funovus/editor-wiki GitHub Wiki
Table of Contents
- [Trigger API Reference\DCEI Functions\Custom UI (2/8)](#trigger-api-referencedcei-functionscustom-ui-28)
* [int GetChildrenFrameCount(Transform parent)](#int-getchildrenframecounttransform-parent)
* [Transform CreateButtonFrame(Transform parent)](#transform-createbuttonframetransform-parent)
* [Transform CreateTextFrame(Transform parent)](#transform-createtextframetransform-parent)
* [Transform CreateUserInputTextFrame(Transform parent)](#transform-createuserinputtextframetransform-parent)
* [Transform CreateInputFrame(Transform parent)](#transform-createinputframetransform-parent)
* [Transform CreateFrameFromXml(Transform parent, string name)](#transform-createframefromxmltransform-parent-string-name)
* [void UpdateFrame(Transform ui, object callback)](#void-updateframetransform-ui-object-callback)
* [object GetFrameState(Transform ui)](#object-getframestatetransform-ui)
* [Transform GetChildFrameById(Transform ui, string id)](#transform-getchildframebyidtransform-ui-string-id)
* [object GetXmlFrames()](#object-getxmlframes)
* [object GetChildrenFramesIdAndFrameType(Transform ui)](#object-getchildrenframesidandframetypetransform-ui)
* [bool IsUiRootFrame(Transform ui)](#bool-isuirootframetransform-ui)
* [void SetCameraFrameViewportSize(Transform ui, int x, int y, bool discardDepth)](#void-setcameraframeviewportsizetransform-ui-int-x-int-y-bool-discarddepth)
* [void SetCameraFrameViewportPosition(Transform ui, float x, float y, float z)](#void-setcameraframeviewportpositiontransform-ui-float-x-float-y-float-z)
* [void SetCameraFrameViewportRotation(Transform ui, float x, float y, float z)](#void-setcameraframeviewportrotationtransform-ui-float-x-float-y-float-z)
* [void SetGridFrameCellWidth(Transform ui, float width)](#void-setgridframecellwidthtransform-ui-float-width)
* [void SetGridFrameCellHeight(Transform ui, float height)](#void-setgridframecellheighttransform-ui-float-height)
* [Tweener AnimateCameraFrameViewportPosition(Transform ui, float x, float y, float z, float duration, string ease)](#tweener-animatecameraframeviewportpositiontransform-ui-float-x-float-y-float-z-float-duration-string-ease)
* [Tweener AnimateCameraFrameViewportRotation(Transform ui, float x, float y, float z, float duration, string ease)](#tweener-animatecameraframeviewportrotationtransform-ui-float-x-float-y-float-z-float-duration-string-ease)
* [Tweener AnimateCameraFrameOrthographicViewportSize(Transform ui, float size, float duration, string ease)](#tweener-animatecameraframeorthographicviewportsizetransform-ui-float-size-float-duration-string-ease)
* [void SetCameraFrameCullingMask(Transform ui, int mask)](#void-setcameraframecullingmasktransform-ui-int-mask)
* [void SetCameraFrameBackgroundColor(Transform ui, ColorRGBA color)](#void-setcameraframebackgroundcolortransform-ui-colorrgba-color)
* [void SetCameraFrameBackgroundColorRGBA(Transform ui, ColorRGBA color)](#void-setcameraframebackgroundcolorrgbatransform-ui-colorrgba-color)
* [void SetCameraFrameViewportOrthographic(Transform ui, bool set)](#void-setcameraframeviewportorthographictransform-ui-bool-set)
* [void SetCameraFrameOrthographicViewportSize(Transform ui, float size)](#void-setcameraframeorthographicviewportsizetransform-ui-float-size)
* [Transform CreateMiniMapFrame(Transform parent, bool hideTerrain)](#transform-createminimapframetransform-parent-bool-hideterrain)
* [void SetCameraFrameEffectColor(Transform ui, ColorRGB color, float saturation, float contrast, float brightness)](#void-setcameraframeeffectcolortransform-ui-colorrgb-color-float-saturation-float-contrast-float-brightness)
* [void SetCameraFrameEffectColorRGB(Transform ui, ColorRGB color, float saturation, float contrast, float brightness)](#void-setcameraframeeffectcolorrgbtransform-ui-colorrgb-color-float-saturation-float-contrast-float-brightness)
* [Transform GetScrollFrameContent(Transform parent)](#transform-getscrollframecontenttransform-parent)
* [void SetScrollFrameScrollPosition(Transform ui, float position)](#void-setscrollframescrollpositiontransform-ui-float-position)
|
Trigger API Reference\DCEI Functions\Custom UI (2/8) {Trigger-API-ReferenceDCEI-FunctionsCustom-UI-28}
- Trigger API Reference\DCEI Functions\Custom UI (1/4)
- Trigger API Reference\DCEI Functions\Custom UI (3/4)
- Trigger API Reference\DCEI Functions\Custom UI (4/4)
int GetChildrenFrameCount(Transform parent)
Returns the number of child frames.
-
Transform
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.
local hscroll_frame = DCEI.NewHScroll(DCEI.GetUiRoot())
DCEI.SetBackgroundImage(hscroll_frame, "frame01")
DCEI.SetSize(hscroll_frame, 350, 120)
local hscroll_content = DCEI.GetScrollContent(hscroll_frame)
DCEI.SetSpacing(hscroll_content, 10)
DCEI.SetPadding(hscroll_content, 10)
local frame1 = DCEI.NewFrame(hscroll_content)
DCEI.SetSize(frame1, 100, 100)
DCEI.SetBackgroundImage(frame1, "frame01_blue")
local frame2 = DCEI.NewFrame(hscroll_content)
DCEI.SetSize(frame2, 100, 100)
DCEI.SetBackgroundImage(frame2, "frame01_brown")
local frame3 = DCEI.NewFrame(hscroll_content)
DCEI.SetSize(frame3, 100, 100)
DCEI.SetBackgroundImage(frame3, "frame01_purple")
local frame4 = DCEI.NewFrame(hscroll_content)
DCEI.SetSize(frame4, 100, 100)
DCEI.SetBackgroundImage(frame4, "frame01_grey")
local frame5 = DCEI.NewFrame(hscroll_content)
DCEI.SetSize(frame5, 100, 100)
DCEI.SetBackgroundImage(frame5, "frame01_yellow")
local child_frame_count = DCEI.GetChildrenFrameCount(hscroll_frame)
DCEI.LogMessage("The number of child frames for 'hscroll_frame': " .. child_frame_count)
Transform CreateButtonFrame(Transform parent)
Creates a new button frame. By default, new buttons use a padding of 12 and btn_green
as their background image. This frame type has a default size of 0 and expands to fit any children.
local button = DCEI.NewButton(DCEI.GetUiRoot())
DCEI.SetSize(button, 120, 50)
- SetEnableButtonExpression()
- SetOnDownCallback()
- SetOnUpCallback()
- SetOnClickCallback()
- SetButtonClickSound()
- SetPauseButton()
- SetPauseMenuResumeButton()
- SetPauseMenuQuitButton()
- SetPauseMenuRestartButton()
- SetPauseMenuPlayLevelButton()
- SetPauseMenuSettingsButton()
Transform CreateTextFrame(Transform parent)
Creates a new text frame. This frame type has a default size of 0 and expand to fit any children.
local text = DCEI.NewText(button)
DCEI.SetText(text, "Button")
- SetTextRtlSupport()
- SetTextAlignment()
- SetTextWrapping()
- SetTextOverflow()
- SetText()
- SetTextExpression()
- SetTextFontSize()
- SetTextFontSizeMin()
- SetTextFontSizeMax()
- SetTextColor()
- SetTextOutline()
- SetTextShadow()
- SetTextOutlineOutside()
- SetTextOutlineColor()
- SetTextOutlineWidth()
- SetTextOutlineSoftness()
- SetTextShadowWidth()
- SetTextShadowColor()
- SetTextShadowSoftness()
- SetTextShadowDirection()
Transform CreateUserInputTextFrame(Transform parent) {Transform-CreateUserInputTextFrameTransform-parent}
Transform CreateUserInputTextFrame(Transform parent)
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.
local input_text = DCEI.NewUserInputText(DCEI.GetUiRoot())
DCEI.SetSize(input_text, 200, 50)
DCEI.SetUserInputText(input_text, "pretend I'm user input text")
Transform CreateInputFrame(Transform parent)
Creates an input UI frame. By default, this frame type attempts to fill its parent size unless given explicit dimensions.
local input = DCEI.NewInput(DCEI.GetUiRoot())
DCEI.SetSize(input, 300, 50)
- GetInputText()
- SetInputText()
- SetInputTextFontSize()
- SetInputTextColor()
- SetInputTextOutline()
- SetInputTextWrapping()
- SetInputPlaceholder()
- SetInputPlaceholderFontSize()
- SetInputPlaceholderColor()
- SetInputPlaceholderOutline()
Transform CreateFrameFromXml(Transform parent, string name) {Transform-CreateFrameFromXmlTransform-parent-string-name}
Transform CreateFrameFromXml(Transform parent, string name)
Creates new UI frame given an XML UI element name. XML UI elements are created in the Data Window in the "UI" tab.
-
Transform
parent
the parent UI frame. -
string
name
the name of the XML UI element to create the UI from.
-- Creates the UI frame defined in Data/UI Tab as "MyCustomUi"
local custom_ui_frame = DCEI.NewUiFromXml(DCEI.GetUiRoot(), "MyCustomUi")
void UpdateFrame(Transform ui, object callback)
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.
local inactive_parent = DCEI.NewFrame(DCEI.GetUiRoot())
DCEI.SetActive(inactive_parent, false)
local function CreateChildFrame()
DCEI.NewFrame(inactive_parent)
end
DCEI.UpdateUi(inactive_parent, CreateChildFrame)
object GetFrameState(Transform ui)
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.
local custom_ui_frame = DCEI.NewUiFromXml(DCEI.GetUiRoot(), "MyCustomUi")
local state = DCEI.GetXmlUiState(custom_ui_frame)
-- updates any lua state conditions defined in the XML element that use the `mode` state
state.mode = "default"
Transform GetChildFrameById(Transform ui, string id) {Transform-GetChildFrameByIdTransform-ui-string-id}
Transform GetChildFrameById(Transform ui, string id)
Returns XML UI frames by their ID. Useful for accessing child frames of an XML UI frame.
local parent = DCEI.NewUiFromXml(DCEI.GetUiRoot(), "MyCustomUi")
local background_frame = DCEI.FindXmlUiById(parent, "Background")
object GetXmlFrames()
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.
local xml_frames = DCEI.GetXmlFrames()
object GetChildrenFramesIdAndFrameType(Transform ui) {object-GetChildrenFramesIdAndFrameTypeTransform-ui}
object GetChildrenFramesIdAndFrameType(Transform ui)
Returns a table of child XML UI frames.
local parent = DCEI.NewUiFromXml(DCEI.GetUiRoot(), "MyCustomUi")
local child_frames = DCEI.GetXmlUiChildrenFrames(parent)
bool IsUiRootFrame(Transform ui)
Returns true if the given UI frame is a top-level XML UI frame.
local parent = DCEI.NewUiFromXml(DCEI.GetUiRoot(), "MyCustomUi")
local xml_root = DCEI.IsXmlUiRoot(parent)
DCEI.LogMessage(tostring(xml_root))
void SetCameraFrameViewportSize(Transform ui, int x, int y, bool discardDepth) {void-SetCameraFrameViewportSizeTransform-ui-int-x-int-y-bool-discardDepth}
void SetCameraFrameViewportSize(Transform ui, int x, int y, bool discardDepth)
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.
-
Transform
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 true.
local unit = DCEI.CreateUnit(1, 1, "Standard MeleeUnit", 16, 12, 0, -1)
local container = DCEI.NewFrame(DCEI.GetUiRoot())
DCEI.SetBackgroundImage(container, "frame01")
DCEI.SetPadding(container, 10)
DCEI.SetTopAlignmentInParent(container)
DCEI.SetLeftAlignmentInParent(container)
local camera = DCEI.NewCameraFrame(container)
DCEI.SetSize(camera, 150, 150)
DCEI.SetCameraFrameSize(camera, 200, 200, true)
DCEI.SetCameraFramePosition(camera, 16, 1, 11)
DCEI.SetCameraFrameRotation(camera, 35, 0, 0)
DCEI.TriggerAddTimerEventElapsed(
function()
DCEI.SetCameraFrameSize(camera, 50, 50, true)
end,
1, true
)
void SetCameraFrameViewportPosition(Transform ui, float x, float y, float z) {void-SetCameraFrameViewportPositionTransform-ui-float-x-float-y-float-z}
void SetCameraFrameViewportPosition(Transform ui, float x, float y, float z)
Sets the position of a camera frame UI. The default position for a new camera frame is {0, 0, 0}.
-
Transform
ui
the camera frame UI to set the size of. -
int
x
the new X coordinate. -
int
y
the new Y coordinate. -
int
z
the new Z coordinate.
local unit = DCEI.CreateUnit(1, 1, "Standard MeleeUnit", 16, 12, 0, -1)
local container = DCEI.NewFrame(DCEI.GetUiRoot())
DCEI.SetBackgroundImage(container, "frame01")
DCEI.SetPadding(container, 10)
DCEI.SetTopAlignmentInParent(container)
DCEI.SetLeftAlignmentInParent(container)
local camera = DCEI.NewCameraFrame(container)
DCEI.SetSize(camera, 150, 150)
DCEI.SetCameraFrameSize(camera, 200, 200, true)
DCEI.SetCameraFramePosition(camera, 16, 1, 11)
DCEI.SetCameraFrameRotation(camera, 35, 0, 0)
DCEI.TriggerAddTimerEventElapsed(
function()
DCEI.SetCameraFramePosition(camera, 16, 1, 10)
end,
1, true
)
void SetCameraFrameViewportRotation(Transform ui, float x, float y, float z) {void-SetCameraFrameViewportRotationTransform-ui-float-x-float-y-float-z}
void SetCameraFrameViewportRotation(Transform ui, float x, float y, float z)
Sets the rotation of a camera frame UI. The default rotation for a new camera frame is {0, 0, 0}.
-
Transform
ui
the camera frame UI to set the rotation of. -
int
x
the rotation about the X axis in degrees. A value of 180 will make the camera face backwards and be flipped vertically. -
int
y
the rotation about the Y axis in degrees. A value of 180 will make the camera face backwards. -
int
z
the rotation about the Z axis rotation in degrees. A value of 180 will make the camera be flipped vertically.
local unit = DCEI.CreateUnit(1, 1, "Standard MeleeUnit", 16, 12, 0, -1)
local container = DCEI.NewFrame(DCEI.GetUiRoot())
DCEI.SetBackgroundImage(container, "frame01")
DCEI.SetPadding(container, 10)
DCEI.SetTopAlignmentInParent(container)
DCEI.SetLeftAlignmentInParent(container)
local camera = DCEI.NewCameraFrame(container)
DCEI.SetSize(camera, 150, 150)
DCEI.SetCameraFrameSize(camera, 200, 200, true)
DCEI.SetCameraFramePosition(camera, 16, 1, 11)
DCEI.SetCameraFrameRotation(camera, 35, 0, 0)
DCEI.TriggerAddTimerEventElapsed(
function()
DCEI.SetCameraFrameRotation(camera, 35, 30, 0)
end,
1, true
)
void SetGridFrameCellWidth(Transform ui, float width) {void-SetGridFrameCellWidthTransform-ui-float-width}
void SetGridFrameCellWidth(Transform ui, float width)
Sets the cell width for a grid.
DCEI.SetGridCellWidth(test, 100)
void SetGridFrameCellHeight(Transform ui, float height) {void-SetGridFrameCellHeightTransform-ui-float-height}
void SetGridFrameCellHeight(Transform ui, float height)
Sets the cell height for a grid.
DCEI.SetGridCellHeight(test, 100)
Tweener AnimateCameraFrameViewportPosition(Transform ui, float x, float y, float z, float duration, string ease) {Tweener-AnimateCameraFrameViewportPositionTransform-ui-float-x-float-y-float-z-float-duration-string-ease}
Tweener AnimateCameraFrameViewportPosition(Transform ui, float x, float y, float z, float duration, string ease)
Animates a camera frame UI to a new position. Returns the UI animation for use in SetAnimationLoops() and StopAnimationLoops().
-
Transform
ui
the camera frame UI to set the size of. -
int
x
the new X coordinate. -
int
y
the new Y coordinate. -
int
z
the new Z coordinate. -
float
duration
the duration of the camera frame animation. A duration of 0 will make the animation instant. -
string
ease
the easing function to use for the animation. See https://easings.net/en for examples. Accepted values:Linear InSine, OutSine, InOutSine InQuad, OutQuad, InOutQuad InCubic, OutCubic, InOutCubic InQuart, OutQuart, InOutQuart InQuint, OutQuint, InOutQuint InExpo, OutExpo, InOutExpo InCirc, OutCirc, InOutCirc InElastic, OutElastic, InOutElastic InBack, OutBack, InOutBack InBounce, OutBounce, InOutBounce Flash, InFlash, OutFlash, InOutFlash
local unit = DCEI.CreateUnit(1, 1, "Standard MeleeUnit", 16, 12, 0, -1)
local container = DCEI.NewVStack(DCEI.GetUiRoot())
DCEI.SetBackgroundImage(container, "frame01")
DCEI.SetPadding(container, 10)
DCEI.SetTopAlignmentInParent(container)
DCEI.SetLeftAlignmentInParent(container)
local camera = DCEI.NewCameraFrame(container)
DCEI.SetSize(camera, 150, 150)
DCEI.SetCameraFrameSize(camera, 200, 200, true)
DCEI.SetCameraFramePosition(camera, 16, 1, 11)
DCEI.SetCameraFrameRotation(camera, 35, 0, 0)
local btn = DCEI.NewButton(container)
DCEI.SetSize(btn, 150, 80)
DCEI.SetOnClickCallback(btn, OnClick)
local text = DCEI.NewText(btn)
DCEI.SetText(text, "Animate")
local state = 0
DCEI.SetOnClickCallback(
btn,
function()
local duration = 0.25
local ease = "Linear"
if state == 0 then
DCEI.AnimateCameraFramePosition(camera, 16, 0.75, 11.5, duration, ease)
state = 1
else
DCEI.AnimateCameraFramePosition(camera, 16, 1, 11, duration, ease)
state = 0
end
end
)
Tweener AnimateCameraFrameViewportRotation(Transform ui, float x, float y, float z, float duration, string ease) {Tweener-AnimateCameraFrameViewportRotationTransform-ui-float-x-float-y-float-z-float-duration-string-ease}
Tweener AnimateCameraFrameViewportRotation(Transform ui, float x, float y, float z, float duration, string ease)
Animates a camera frame UI to a new rotation. Returns the UI animation for use in SetAnimationLoops() and StopAnimationLoops().
-
Transform
ui
the camera frame UI to set the rotation of. -
int
x
the rotation about the X axis in degrees. A value of 180 will make the camera face backwards and be flipped vertically. -
int
y
the rotation about the Y axis in degrees. A value of 180 will make the camera face backwards. -
int
z
the rotation about the Z axis rotation in degrees. A value of 180 will make the camera be flipped vertically. -
float
duration
the duration of the camera frame animation. A duration of 0 will make the animation instant. -
string
ease
the easing function to use for the animation. See https://easings.net/en for examples. Accepted values:Linear InSine, OutSine, InOutSine InQuad, OutQuad, InOutQuad InCubic, OutCubic, InOutCubic InQuart, OutQuart, InOutQuart InQuint, OutQuint, InOutQuint InExpo, OutExpo, InOutExpo InCirc, OutCirc, InOutCirc InElastic, OutElastic, InOutElastic InBack, OutBack, InOutBack InBounce, OutBounce, InOutBounce Flash, InFlash, OutFlash, InOutFlash
local unit = DCEI.CreateUnit(1, 1, "Standard MeleeUnit", 16, 12, 0, -1)
local container = DCEI.NewVStack(DCEI.GetUiRoot())
DCEI.SetBackgroundImage(container, "frame01")
DCEI.SetPadding(container, 10)
DCEI.SetTopAlignmentInParent(container)
DCEI.SetLeftAlignmentInParent(container)
local camera = DCEI.NewCameraFrame(container)
DCEI.SetSize(camera, 150, 150)
DCEI.SetCameraFrameSize(camera, 200, 200, true)
DCEI.SetCameraFramePosition(camera, 16, 1, 11)
DCEI.SetCameraFrameRotation(camera, 35, 0, 0)
local btn = DCEI.NewButton(container)
DCEI.SetSize(btn, 150, 80)
DCEI.SetOnClickCallback(btn, OnClick)
local text = DCEI.NewText(btn)
DCEI.SetText(text, "Animate")
local state = 0
DCEI.SetOnClickCallback(
btn,
function()
local duration = 0.25
local ease = "Linear"
if state == 0 then
DCEI.AnimateCameraFrameRotation(camera, 35 , 45, 0, duration, ease)
state = 1
else
DCEI.AnimateCameraFrameRotation(camera, 35 , 0, 0, duration, ease)
state = 0
end
end
)
Tweener AnimateCameraFrameOrthographicViewportSize(Transform ui, float size, float duration, string ease) {Tweener-AnimateCameraFrameOrthographicViewportSizeTransform-ui-float-size-float-duration-string-ease}
Tweener AnimateCameraFrameOrthographicViewportSize(Transform ui, float size, float duration, string ease)
Animates a camera frame UI to a new orthographic size. Returns the UI animation for use in SetAnimationLoops() and StopAnimationLoops().
-
Transform
ui
the camera frame UI to set the rotation of. -
int
size
the new orthographic size. -
float
duration
the duration of the camera frame animation. A duration of 0 will make the animation instant. -
string
ease
the easing function to use for the animation. See https://easings.net/en for examples. Accepted values:Linear InSine, OutSine, InOutSine InQuad, OutQuad, InOutQuad InCubic, OutCubic, InOutCubic InQuart, OutQuart, InOutQuart InQuint, OutQuint, InOutQuint InExpo, OutExpo, InOutExpo InCirc, OutCirc, InOutCirc InElastic, OutElastic, InOutElastic InBack, OutBack, InOutBack InBounce, OutBounce, InOutBounce Flash, InFlash, OutFlash, InOutFlash
local unit = DCEI.CreateUnit(1, 1, "Standard MeleeUnit", 16, 12, 0, -1)
local container = DCEI.NewVStack(DCEI.GetUiRoot())
DCEI.SetBackgroundImage(container, "frame01")
DCEI.SetPadding(container, 10)
DCEI.SetTopAlignmentInParent(container)
DCEI.SetLeftAlignmentInParent(container)
local camera = DCEI.NewCameraFrame(container)
DCEI.SetSize(camera, 150, 150)
DCEI.SetCameraFrameSize(camera, 200, 200, true)
DCEI.SetCameraFrameOrthographic(camera, true)
DCEI.SetCameraFrameOrthographicSize(camera, 1)
DCEI.SetCameraFramePosition(camera, 16, 1, 11)
DCEI.SetCameraFrameRotation(camera, 35, 0, 0)
local animation = DCEI.AnimateCameraFrameOrthographicSize(camera, 2, 5, "Linear")
- NewCameraFrame()
- SetAnimationLoops()
- StopAnimationLoops()
- SetCameraFrameOrthographic()
- SetCameraFrameOrthographicSize()
void SetCameraFrameCullingMask(Transform ui, int mask) {void-SetCameraFrameCullingMaskTransform-ui-int-mask}
void SetCameraFrameCullingMask(Transform ui, int mask)
Sets a culling mask for a camera frame that can be used to remove rendering layers from a camera frame.
-
Transform
ui
the camera frame. -
int
mask
the culling mask to apply. Odd values will remove the terrain, even values will remove everything.
local unit = DCEI.CreateUnit(1, 1, "Standard MeleeUnit", 16, 12, 0, -1)
local container = DCEI.NewVStack(DCEI.GetUiRoot())
DCEI.SetBackgroundImage(container, "frame01")
DCEI.SetPadding(container, 10)
DCEI.SetTopAlignmentInParent(container)
DCEI.SetLeftAlignmentInParent(container)
local camera = DCEI.NewCameraFrame(container)
DCEI.SetSize(camera, 150, 150)
DCEI.SetCameraFrameSize(camera, 200, 200, true)
DCEI.SetCameraFramePosition(camera, 16, 1, 11)
DCEI.SetCameraFrameRotation(camera, 35, 0, 0)
DCEI.SetCameraFrameCullingMask(camera, 1)
void SetCameraFrameBackgroundColor(Transform ui, ColorRGBA color) {void-SetCameraFrameBackgroundColorTransform-ui-ColorRGBA-color}
void SetCameraFrameBackgroundColor(Transform ui, ColorRGBA color)
Set background color for a camera frame.
-
Transform
ui
the camera frame. -
ColorRGBA
color
the RGBA values.
local camera = DCEI.NewCameraFrame(container)
DCEI.SetCameraFrameBackgroundColor(camera, {r = 0.5, g = 0.5, b = 0, a = 0.5})
void SetCameraFrameBackgroundColorRGBA(Transform ui, ColorRGBA color) {void-SetCameraFrameBackgroundColorRGBATransform-ui-ColorRGBA-color}
void SetCameraFrameBackgroundColorRGBA(Transform ui, ColorRGBA color)
Set background color for a camera frame.
-
Transform
ui
the camera frame. -
ColorRGBA
color
the RGBA values.
local camera = DCEI.NewCameraFrame(container)
DCEI.SetCameraFrameBackgroundColorRGBA(camera, {r = 0.5, g = 0.5, b = 0, a = 0.5})
void SetCameraFrameViewportOrthographic(Transform ui, bool set) {void-SetCameraFrameViewportOrthographicTransform-ui-bool-set}
void SetCameraFrameViewportOrthographic(Transform ui, bool set)
Enables orthographic view for a camera frame. Note that orthographic camera size must be set independently using DCEI.SetCameraFrameOrthographicSize().
local unit = DCEI.CreateUnit(1, 1, "Standard MeleeUnit", 16, 12, 0, -1)
local container = DCEI.NewVStack(DCEI.GetUiRoot())
DCEI.SetBackgroundImage(container, "frame01")
DCEI.SetPadding(container, 10)
DCEI.SetTopAlignmentInParent(container)
DCEI.SetLeftAlignmentInParent(container)
local camera = DCEI.NewCameraFrame(container)
DCEI.SetSize(camera, 150, 150)
DCEI.SetCameraFrameSize(camera, 200, 200, true)
DCEI.SetCameraFramePosition(camera, 16, 1, 11)
DCEI.SetCameraFrameRotation(camera, 35, 0, 0)
DCEI.SetCameraFrameOrthographic(camera, true)
DCEI.SetCameraFrameOrthographicSize(camera, 1)
void SetCameraFrameOrthographicViewportSize(Transform ui, float size) {void-SetCameraFrameOrthographicViewportSizeTransform-ui-float-size}
void SetCameraFrameOrthographicViewportSize(Transform ui, float size)
Sets the orthographic size for a camera frame.
local unit = DCEI.CreateUnit(1, 1, "Standard MeleeUnit", 16, 12, 0, -1)
local container = DCEI.NewVStack(DCEI.GetUiRoot())
DCEI.SetBackgroundImage(container, "frame01")
DCEI.SetPadding(container, 10)
DCEI.SetTopAlignmentInParent(container)
DCEI.SetLeftAlignmentInParent(container)
local camera = DCEI.NewCameraFrame(container)
DCEI.SetSize(camera, 150, 150)
DCEI.SetCameraFrameSize(camera, 200, 200, true)
DCEI.SetCameraFramePosition(camera, 16, 1, 11)
DCEI.SetCameraFrameRotation(camera, 35, 0, 0)
DCEI.SetCameraFrameOrthographic(camera, true)
DCEI.SetCameraFrameOrthographicSize(camera, 1)
DCEI.TriggerAddTimerEventElapsed(
function()
DCEI.SetCameraFrameOrthographicSize(camera, 2)
end,
1, true
)
Transform CreateMiniMapFrame(Transform parent, bool hideTerrain) {Transform-CreateMiniMapFrameTransform-parent-bool-hideTerrain}
Transform CreateMiniMapFrame(Transform parent, bool hideTerrain)
Creates a minimap frame. Use CameraFrame
functions to modify the frame. The default resolution for the minimap is 1x1.
local minimap = DCEI.NewMiniMapFrame(DCEI.GetUiRoot(), false)
DCEI.SetCameraFrameSize(minimap, 500, 500, true)
DCEI.SetSize(minimap, 200, 200)
- SetCameraFrameSize()
- SetCameraFramePosition()
- SetCameraFrameRotation()
- AnimateCameraFramePosition()
- AnimateCameraFrameRotation()
- AnimateCameraFrameOrthographicSize()
- SetCameraFrameCullingMask()
- SetUiCameraBackgroundColor()
- SetCameraFrameOrthographic()
- SetCameraFrameOrthographicSize()
- NewMiniMapFrame()
- Unit Mini Map Config
void SetCameraFrameEffectColor(Transform ui, ColorRGB color, float saturation, float contrast, float brightness) {void-SetCameraFrameEffectColorTransform-ui-ColorRGB-color-float-saturation-float-contrast-float-brightness}
void SetCameraFrameEffectColor(Transform ui, ColorRGB color, float saturation, float contrast, float brightness)
Set effect color for a camera frame.
-
Transform
ui
the camera frame. -
ColorRGBA
color
the RGBA values. -
float
saturation
the saturation of color effect. -
float
contrast
the contrast of color effect. -
float
brightness
the brightness of color effect.
local camera = DCEI.NewCameraFrame(container)
DCEI.SetCameraFrameEffectColor(camera, {r = 0.5, g = 0.5, b = 0, a = 0.5}, 1, 0.5, 1)
void SetCameraFrameEffectColorRGB(Transform ui, ColorRGB color, float saturation, float contrast, float brightness) {void-SetCameraFrameEffectColorRGBTransform-ui-ColorRGB-color-float-saturation-float-contrast-float-brightness}
void SetCameraFrameEffectColorRGB(Transform ui, ColorRGB color, float saturation, float contrast, float brightness)
Set effect color for a camera frame.
-
Transform
ui
the camera frame. -
ColorRGBA
color
the RGBA values. -
float
saturation
the saturation of color effect. -
float
contrast
the contrast of color effect. -
float
brightness
the brightness of color effect.
local camera = DCEI.NewCameraFrame(container)
DCEI.SetCameraFrameEffectColorRGB(camera, {r = 0.5, g = 0.5, b = 0, a = 0.5}, 1, 0.5, 1)
Transform GetScrollFrameContent(Transform parent)
Returns the content frame of a scroll frame.
local scroll = DCEI.NewScroll(DCEI.GetUiRoot())
local content = DCEI.GetScrollContent(scroll)
void SetScrollFrameScrollPosition(Transform ui, float position) {void-SetScrollFrameScrollPositionTransform-ui-float-position}
void SetScrollFrameScrollPosition(Transform ui, float position)
Sets the scroll position for an HScroll or VScroll frames.
-
Transform
ui
the scroll frame (not the scroll content frame). -
float
position
the offset to set the scroll to.
local vscroll_frame = DCEI.NewVScroll(DCEI.GetUiRoot())
DCEI.SetSize(vscroll_frame, 200, 300)
DCEI.SetBackgroundImageColor(vscroll_frame, 1, 0, 0, 0.3)
DCEI.SetScrollPosition(vscroll_frame, 300)
local content = DCEI.GetScrollContent(vscroll_frame)
local frame1 = DCEI.NewFrame(content)
DCEI.SetSize(frame1, 150, 400)
DCEI.SetBackgroundImageColor(frame1, 1, 0, 0, 1)
local frame2 = DCEI.NewFrame(content)
DCEI.SetSize(frame2, 150, 400)
DCEI.SetBackgroundImageColor(frame2, 0, 0, 1, 1)