Trigger API Reference DCEI Functions Custom UI4 - funovus/editor-wiki GitHub Wiki
Table of Contents
- [Trigger API Reference\DCEI Functions\Custom UI (5/8)](#trigger-api-referencedcei-functionscustom-ui-58)
* [void SetFramePaddingLeft(Transform ui, float padding)](#void-setframepaddinglefttransform-ui-float-padding)
* [void SetFramePaddingRight(Transform ui, float padding)](#void-setframepaddingrighttransform-ui-float-padding)
* [void SetFramePaddingTop(Transform ui, float padding)](#void-setframepaddingtoptransform-ui-float-padding)
* [void SetFramePaddingBottom(Transform ui, float padding)](#void-setframepaddingbottomtransform-ui-float-padding)
* [void SetFrameSpacing(Transform ui, float spacing)](#void-setframespacingtransform-ui-float-spacing)
* [void SetFrameLeftAlignment(Transform ui)](#void-setframeleftalignmenttransform-ui)
* [void SetFrameRightAlignment(Transform ui)](#void-setframerightalignmenttransform-ui)
* [void SetFrameTopAlignment(Transform ui)](#void-setframetopalignmenttransform-ui)
* [void SetFrameBottomAlignment(Transform ui)](#void-setframebottomalignmenttransform-ui)
* [void SetFrameCenterAlignment(Transform ui)](#void-setframecenteralignmenttransform-ui)
* [void SetFrameLeftAlignmentInParent(Transform ui)](#void-setframeleftalignmentinparenttransform-ui)
* [void SetFrameRightAlignmentInParent(Transform ui)](#void-setframerightalignmentinparenttransform-ui)
* [void SetFrameTopAlignmentInParent(Transform ui)](#void-setframetopalignmentinparenttransform-ui)
* [void SetFrameBottomAlignmentInParent(Transform ui)](#void-setframebottomalignmentinparenttransform-ui)
* [void SetFrameCenterAlignmentInParent(Transform ui)](#void-setframecenteralignmentinparenttransform-ui)
* [void SetFrameHorizontalOffsetInParent(Transform ui, float value)](#void-setframehorizontaloffsetinparenttransform-ui-float-value)
* [void SetFrameVerticalOffsetInParent(Transform ui, float value)](#void-setframeverticaloffsetinparenttransform-ui-float-value)
* [void SetFrameReverseChildrenFrameOrder(Transform ui, bool value)](#void-setframereversechildrenframeordertransform-ui-bool-value)
* [void SetFrameImage(Transform ui, string name)](#void-setframeimagetransform-ui-string-name)
* [void SetFrameImageExpression(Transform ui, string expression)](#void-setframeimageexpressiontransform-ui-string-expression)
* [void SetFrameImageGrayScaleExpression(Transform ui, string expression)](#void-setframeimagegrayscaleexpressiontransform-ui-string-expression)
* [void SetButtonFrameEnableExpression(Transform ui, string expression)](#void-setbuttonframeenableexpressiontransform-ui-string-expression)
* [void SetFrameImageTiled(Transform ui, bool setTiled)](#void-setframeimagetiledtransform-ui-bool-settiled)
* [void SetFramePixelsPerUnitMultiplier(Transform ui, float pixelsPerUnitMultiplier)](#void-setframepixelsperunitmultipliertransform-ui-float-pixelsperunitmultiplier)
* [void SetFrameImageFillAmount(Transform ui, float fill)](#void-setframeimagefillamounttransform-ui-float-fill)
* [float GetFrameImageFillAmount(Transform ui)](#float-getframeimagefillamounttransform-ui)
* [void SetFrameImageFillHorizontal(Transform ui)](#void-setframeimagefillhorizontaltransform-ui)
* [void SetFrameImageFillVertical(Transform ui)](#void-setframeimagefillverticaltransform-ui)
* [void SetFrameImageFillRadial(Transform ui)](#void-setframeimagefillradialtransform-ui)
* [void SetFrameImageFillOrigin(Transform ui, int origin)](#void-setframeimagefillorigintransform-ui-int-origin)
|
Trigger API Reference\DCEI Functions\Custom UI (5/8) {Trigger-API-ReferenceDCEI-FunctionsCustom-UI-58}
void SetFramePaddingLeft(Transform ui, float padding) {void-SetFramePaddingLeftTransform-ui-float-padding}
void SetFramePaddingLeft(Transform ui, float padding)
Sets the left padding for a UI frame.
local frame1 = DCEI.NewFrame(DCEI.GetUiRoot())
DCEI.SetBackgroundImageColor(frame1, 1, 0, 1, 0.4)
DCEI.SetPaddingLeft(frame, 20)
local frame2 = DCEI.NewFrame(frame1)
DCEI.SetSize(frame2, 100, 100)
DCEI.SetBackgroundImageColor(frame2, 0, 1, 1, 0.4)
void SetFramePaddingRight(Transform ui, float padding) {void-SetFramePaddingRightTransform-ui-float-padding}
void SetFramePaddingRight(Transform ui, float padding)
Sets the right padding for a UI frame.
local frame1 = DCEI.NewFrame(DCEI.GetUiRoot())
DCEI.SetBackgroundImageColor(frame1, 1, 0, 1, 0.4)
DCEI.SetPaddingRight(frame1, 20)
local frame2 = DCEI.NewFrame(frame1)
DCEI.SetSize(frame2, 100, 100)
DCEI.SetBackgroundImageColor(frame2, 0, 1, 1, 0.4)
void SetFramePaddingTop(Transform ui, float padding) {void-SetFramePaddingTopTransform-ui-float-padding}
void SetFramePaddingTop(Transform ui, float padding)
Sets the top padding for a UI frame.
local frame1 = DCEI.NewFrame(DCEI.GetUiRoot())
DCEI.SetBackgroundImageColor(frame1, 1, 0, 1, 0.4)
DCEI.SetPaddingTop(frame1, 20)
local frame2 = DCEI.NewFrame(frame1)
DCEI.SetSize(frame2, 100, 100)
DCEI.SetBackgroundImageColor(frame2, 0, 1, 1, 0.4)
void SetFramePaddingBottom(Transform ui, float padding) {void-SetFramePaddingBottomTransform-ui-float-padding}
void SetFramePaddingBottom(Transform ui, float padding)
Sets the bottom padding for a UI frame.
local frame1 = DCEI.NewFrame(DCEI.GetUiRoot())
DCEI.SetBackgroundImageColor(frame1, 1, 0, 1, 0.4)
DCEI.SetPaddingBottom(frame1, 20)
local frame2 = DCEI.NewFrame(frame1)
DCEI.SetSize(frame2, 100, 100)
DCEI.SetBackgroundImageColor(frame2, 0, 1, 1, 0.4)
void SetFrameSpacing(Transform ui, float spacing)
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 DCEI.GetScrollContent().
local stack = DCEI.NewVStack(DCEI.GetUiRoot())
DCEI.SetBackgroundImageColor(stack, 0, 0, 0, 0.4)
DCEI.SetSpacing(stack, 20)
DCEI.SetPadding(stack, 20)
local frame1 = DCEI.NewFrame(stack)
DCEI.SetSize(frame1, 100, 100)
DCEI.SetBackgroundImageColor(frame1, 1, 0, 1, 0.4)
local frame2 = DCEI.NewFrame(stack)
DCEI.SetSize(frame2, 100, 100)
DCEI.SetBackgroundImageColor(frame2, 0, 1, 1, 0.4)
void SetFrameLeftAlignment(Transform ui)
Sets left alignment for a UI frame's contents.
local frame1 = DCEI.NewFrame(DCEI.GetUiRoot())
DCEI.SetSize(frame1, 200, 200)
DCEI.SetBackgroundImageColor(frame1, 1, 0, 1, 0.4)
DCEI.SetLeftAlignment(frame1)
local frame2 = DCEI.NewFrame(frame1)
DCEI.SetSize(frame2, 100, 100)
DCEI.SetBackgroundImageColor(frame2, 0, 1, 1, 0.4)
void SetFrameRightAlignment(Transform ui)
Sets right alignment for a UI frame's contents.
local frame1 = DCEI.NewFrame(DCEI.GetUiRoot())
DCEI.SetSize(frame1, 200, 200)
DCEI.SetBackgroundImageColor(frame1, 1, 0, 1, 0.4)
DCEI.SetRightAlignment(frame1)
local frame2 = DCEI.NewFrame(frame1)
DCEI.SetSize(frame2, 100, 100)
DCEI.SetBackgroundImageColor(frame2, 0, 1, 1, 0.4)
void SetFrameTopAlignment(Transform ui)
Sets top alignment for a UI frame's contents.
local frame1 = DCEI.NewFrame(DCEI.GetUiRoot())
DCEI.SetSize(frame1, 200, 200)
DCEI.SetBackgroundImageColor(frame1, 1, 0, 1, 0.4)
DCEI.SetTopAlignment(frame1)
local frame2 = DCEI.NewFrame(frame1)
DCEI.SetSize(frame2, 100, 100)
DCEI.SetBackgroundImageColor(frame2, 0, 1, 1, 0.4)
void SetFrameBottomAlignment(Transform ui)
Sets bottom alignment for a UI frame's contents.
local frame1 = DCEI.NewFrame(DCEI.GetUiRoot())
DCEI.SetSize(frame1, 200, 200)
DCEI.SetBackgroundImageColor(frame1, 1, 0, 1, 0.4)
DCEI.SetBottomAlignment(frame1)
local frame2 = DCEI.NewFrame(frame1)
DCEI.SetSize(frame2, 100, 100)
DCEI.SetBackgroundImageColor(frame2, 0, 1, 1, 0.4)
void SetFrameCenterAlignment(Transform ui)
Sets center alignment for a UI frame's contents. This is the default alignment.
local frame1 = DCEI.NewFrame(DCEI.GetUiRoot())
DCEI.SetSize(frame1, 200, 200)
DCEI.SetBackgroundImageColor(frame1, 1, 0, 1, 0.4)
DCEI.SetBottomAlignment(frame1)
local frame2 = DCEI.NewFrame(frame1)
DCEI.SetSize(frame2, 100, 100)
DCEI.SetBackgroundImageColor(frame2, 0, 1, 1, 0.4)
DCEI.TriggerAddTimerEventElapsed(
function()
DCEI.SetCenterAlignment(frame1)
end,
1, true
)
void SetFrameLeftAlignmentInParent(Transform ui)
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.
local frame1 = DCEI.NewFrame(DCEI.GetUiRoot())
DCEI.SetSize(frame1, 200, 200)
DCEI.SetBackgroundImageColor(frame1, 1, 0, 1, 0.4)
local frame2 = DCEI.NewFrame(frame1)
DCEI.SetSize(frame2, 100, 100)
DCEI.SetBackgroundImageColor(frame2, 0, 1, 1, 0.4)
DCEI.SetLeftAlignmentInParent(frame2)
void SetFrameRightAlignmentInParent(Transform ui)
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.
local frame1 = DCEI.NewFrame(DCEI.GetUiRoot())
DCEI.SetSize(frame1, 200, 200)
DCEI.SetBackgroundImageColor(frame1, 1, 0, 1, 0.4)
local frame2 = DCEI.NewFrame(frame1)
DCEI.SetSize(frame2, 100, 100)
DCEI.SetBackgroundImageColor(frame2, 0, 1, 1, 0.4)
DCEI.SetRightAlignmentInParent(frame2)
void SetFrameTopAlignmentInParent(Transform ui)
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.
local frame1 = DCEI.NewFrame(DCEI.GetUiRoot())
DCEI.SetSize(frame1, 200, 200)
DCEI.SetBackgroundImageColor(frame1, 1, 0, 1, 0.4)
local frame2 = DCEI.NewFrame(frame1)
DCEI.SetSize(frame2, 100, 100)
DCEI.SetBackgroundImageColor(frame2, 0, 1, 1, 0.4)
DCEI.SetTopAlignmentInParent(frame2)
void SetFrameBottomAlignmentInParent(Transform ui) {void-SetFrameBottomAlignmentInParentTransform-ui}
void SetFrameBottomAlignmentInParent(Transform ui)
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.
local frame1 = DCEI.NewFrame(DCEI.GetUiRoot())
DCEI.SetSize(frame1, 200, 200)
DCEI.SetBackgroundImageColor(frame1, 1, 0, 1, 0.4)
local frame2 = DCEI.NewFrame(frame1)
DCEI.SetSize(frame2, 100, 100)
DCEI.SetBackgroundImageColor(frame2, 0, 1, 1, 0.4)
DCEI.SetBottomAlignmentInParent(frame2)
void SetFrameCenterAlignmentInParent(Transform ui) {void-SetFrameCenterAlignmentInParentTransform-ui}
void SetFrameCenterAlignmentInParent(Transform ui)
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.
local frame1 = DCEI.NewFrame(DCEI.GetUiRoot())
DCEI.SetSize(frame1, 200, 200)
DCEI.SetBackgroundImageColor(frame1, 1, 0, 1, 0.4)
local frame2 = DCEI.NewFrame(frame1)
DCEI.SetSize(frame2, 100, 100)
DCEI.SetBackgroundImageColor(frame2, 0, 1, 1, 0.4)
DCEI.SetBottomAlignmentInParent(frame2)
DCEI.TriggerAddTimerEventElapsed(
function()
DCEI.SetCenterAlignmentInParent(frame2)
end,
1, true
)
void SetFrameHorizontalOffsetInParent(Transform ui, float value) {void-SetFrameHorizontalOffsetInParentTransform-ui-float-value}
void SetFrameHorizontalOffsetInParent(Transform ui, float value)
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.
local frame = DCEI.NewFrame(DCEI.GetUiRoot())
DCEI.SetSize(frame, 200, 200)
DCEI.SetBackgroundImageColor(frame, 1, 0, 1, 0.4)
DCEI.SetHorizontalOffsetInParent(frame, 200)
void SetFrameVerticalOffsetInParent(Transform ui, float value) {void-SetFrameVerticalOffsetInParentTransform-ui-float-value}
void SetFrameVerticalOffsetInParent(Transform ui, float value)
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.
local frame = DCEI.NewFrame(DCEI.GetUiRoot())
DCEI.SetSize(frame, 200, 200)
DCEI.SetBackgroundImageColor(frame, 1, 0, 1, 0.4)
DCEI.SetVerticalOffsetInParent(frame, 100)
void SetFrameReverseChildrenFrameOrder(Transform ui, bool value) {void-SetFrameReverseChildrenFrameOrderTransform-ui-bool-value}
void SetFrameReverseChildrenFrameOrder(Transform ui, bool value)
Reverses the order in which frames are added to a HStack, VStack, HScroll, or VScroll. This will affect newly added child frames as well as any child frames that have already been added.
-
Transform
ui
the frame to reverse the layout order for. -
bool
value
if true, reverses the layout order.
local stack = DCEI.NewVStack(DCEI.GetUiRoot())
DCEI.SetBackgroundImageColor(stack, 0, 0, 0, 0.4)
DCEI.SetSpacing(stack, 20)
DCEI.SetPadding(stack, 20)
local frame1 = DCEI.NewFrame(stack)
DCEI.SetSize(frame1, 100, 100)
DCEI.SetBackgroundImageColor(frame1, 1, 0, 1, 0.4)
local frame2 = DCEI.NewFrame(stack)
DCEI.SetSize(frame2, 100, 100)
DCEI.SetBackgroundImageColor(frame2, 0, 1, 1, 0.4)
DCEI.TriggerAddTimerEventElapsed(
function()
DCEI.SetReverseLayoutOrder(stack, true)
end,
1, true
)
void SetFrameImage(Transform ui, string name)
Sets the background image of a UI frame.
local frame = DCEI.NewFrame(DCEI.GetUiRoot())
DCEI.SetSize(frame, 100, 100)
DCEI.SetBackgroundImage(frame, "airship_onMap")
void SetFrameImageExpression(Transform ui, string expression) {void-SetFrameImageExpressionTransform-ui-string-expression}
void SetFrameImageExpression(Transform ui, string expression)
Sets the background image of a frame to the given expression. Expressions use data bound by DCEI.BindData() or BindUnit().
local vstack = DCEI.NewVStack(DCEI.GetUiRoot())
local data_frame = DCEI.NewFrame(vstack)
DCEI.SetSize(data_frame, 100, 100)
local data = {image = "airship_onMap"}
DCEI.BindData("data", data)
DCEI.SetBackgroundImageExpression(data_frame, "data.image")
local unit_frame = DCEI.NewFrame(vstack)
DCEI.SetSize(unit_frame, 100, 100)
local unit = DCEI.CreateUnit(1, 1, "Standard MeleeUnit", 16, 16, 0, -1)
DCEI.BindUnit("selected", unit)
-- this will display the icon of the bound unit, however none of the default units have icons
DCEI.SetBackgroundImageExpression(unit_frame, "selected.Info.Icon")
void SetFrameImageGrayScaleExpression(Transform ui, string expression) {void-SetFrameImageGrayScaleExpressionTransform-ui-string-expression}
void SetFrameImageGrayScaleExpression(Transform ui, string expression)
Sets the background image of a frame to the given expression in gray scale. Expressions use data bound by DCEI.BindData() or BindUnit().
-
Transform
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.
local vstack = DCEI.NewVStack(DCEI.GetUiRoot())
local data_frame = DCEI.NewFrame(vstack)
DCEI.SetSize(data_frame, 100, 100)
local data = {image = "airship_onMap", gray = 1}
DCEI.BindData("data", data)
DCEI.SetBackgroundImageExpression(data_frame, "data.image")
DCEI.SetBackgroundImageGrayScaleExpression(data_frame, "data.gray")
local unit_frame = DCEI.NewFrame(vstack)
DCEI.SetSize(unit_frame, 100, 100)
local unit = DCEI.CreateUnit(1, 1, "Standard MeleeUnit", 16, 16, 0, -1)
DCEI.BindUnit("selected", unit)
-- this will display the icon of the bound unit, however none of the default units have icons
DCEI.SetBackgroundImageExpression(unit_frame, "selected.Info.Icon")
-- background image will be grayed out while the unit's health is >0
DCEI.SetBackgroundImageGrayScaleExpression(unit_frame, "selected.Health.Fraction")
void SetButtonFrameEnableExpression(Transform ui, string expression) {void-SetButtonFrameEnableExpressionTransform-ui-string-expression}
void SetButtonFrameEnableExpression(Transform ui, string expression)
Sets an expression to enable a button. Expressions use data bound by DCEI.BindData() or BindUnit().
-
Transform
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.
local vstack = DCEI.NewVStack(DCEI.GetUiRoot())
local data_button = DCEI.NewButton(vstack)
DCEI.SetSize(data_button, 100, 100)
local btn_data = {enable = 0}
DCEI.BindData("data", btn_data)
DCEI.SetEnableButtonExpression(data_button, "data.enable")
local unit_button = DCEI.NewButton(vstack)
DCEI.SetSize(unit_button, 100, 100)
local unit = DCEI.CreateUnit(1, 1, "Standard MeleeUnit 2", 16, 16, 0, -1)
DCEI.BindUnit("selected", unit)
-- button will be disabled when the unit is dead
DCEI.SetEnableButtonExpression(unit_button, "selected.Health.Fraction")
void SetBackgroundImageTiled(Transform ui, bool setTiled)
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 DCEI.SetPixelsPerUnitMultiplier.
-
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.
local frame = DCEI.NewFrame(DCEI.GetUiRoot())
DCEI.SetSize(frame, 400, 400)
DCEI.SetBackgroundImage(frame, "airship_onMap")
DCEI.SetBackgroundImageTiled(frame, true)
void SetFrameImageTiled(Transform ui, bool setTiled) {void-SetFrameImageTiledTransform-ui-bool-setTiled}
void SetFrameImageTiled(Transform ui, bool setTiled)
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 DCEI.SetPixelsPerUnitMultiplier.
-
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.
local frame = DCEI.CreateFrame(DCEI.GetUiRootFrame())
DCEI.SetSize(frame, 400, 400)
DCEI.SetFrameImage(frame, "airship_onMap")
DCEI.SetFrameImageTiled(frame, true)
void SetFramePixelsPerUnitMultiplier(Transform ui, float pixelsPerUnitMultiplier) {void-SetFramePixelsPerUnitMultiplierTransform-ui-float-pixelsPerUnitMultiplier}
void SetFramePixelsPerUnitMultiplier(Transform ui, float pixelsPerUnitMultiplier)
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 DCEI.SetBackgroundImageTiled() and the edge/corner resolution of nineslice textures.
-
Transform
ui
the frame to set the multiplier for. -
float
pixelsPerUnitMultiplier
the pixels per unit multiplier.
-- This would reduce the frame's background image's size to 1/5.
local frame = DCEI.NewFrame(DCEI.GetUiRoot())
DCEI.SetBackgroundImage(frame, "airship_onMap")
DCEI.SetSize(frame, 500, 500)
DCEI.SetPixelsPerUnitMultiplier(frame, 5)
void SetFrameImageFillAmount(Transform ui, float fill) {void-SetFrameImageFillAmountTransform-ui-float-fill}
void SetFrameImageFillAmount(Transform ui, float fill)
Sets the fill amount for the background image.
-
Transform
ui
the frame to set the background image fill amount for. -
float
fill
the fill amount (between 0 and 1).
local frame = DCEI.NewFrame(DCEI.GetUiRoot())
DCEI.SetSize(frame, 100, 100)
DCEI.SetBackgroundImage(frame, "airship_onMap")
DCEI.SetBackgroundImageFillAmount(frame, 0.5)
- GetBackgroundImageFillAmount()
- SetBackgroundImageFillHorizontal()
- SetBackgroundImageFillVertical()
- SetBackgroundImageFillRadial()
- SetBackgroundImageFillOrigin()
- SetBackgroundImageFillAmountExpression()
- AnimateBackgroundImageFillAmount()
float GetFrameImageFillAmount(Transform ui)
Returns the background image fill amount.
local frame = DCEI.NewFrame(DCEI.GetUiRoot())
DCEI.SetSize(frame, 100, 100)
DCEI.SetBackgroundImage(frame, "airship_onMap")
DCEI.SetBackgroundImageFillAmount(frame, 0.5)
local fill = DCEI.GetBackgroundImageFillAmount(frame)
DCEI.LogMessage("Frame background image fill amount: " .. fill)
- SetBackgroundImageFillAmount()
- SetBackgroundImageFillHorizontal()
- SetBackgroundImageFillVertical()
- SetBackgroundImageFillRadial()
- SetBackgroundImageFillOrigin()
- SetBackgroundImageFillAmountExpression()
- AnimateBackgroundImageFillAmount()
void SetFrameImageFillHorizontal(Transform ui)
Sets the background image fill for a frame to be horizontal. This is the default fill direction.
local frame = DCEI.NewFrame(DCEI.GetUiRoot())
DCEI.SetSize(frame, 100, 100)
DCEI.SetBackgroundImage(frame, "airship_onMap")
DCEI.SetBackgroundImageFillAmount(frame, 0.5)
DCEI.SetBackgroundImageFillHorizontal(frame)
- SetBackgroundImageFillAmount()
- GetBackgroundImageFillAmount()
- SetBackgroundImageFillVertical()
- SetBackgroundImageFillRadial()
- SetBackgroundImageFillOrigin()
- SetBackgroundImageFillAmountExpression()
- AnimateBackgroundImageFillAmount()
void SetFrameImageFillVertical(Transform ui)
Sets the background image fill for a frame to be vertical. The default fill direction is horizontal.
local frame = DCEI.NewFrame(DCEI.GetUiRoot())
DCEI.SetSize(frame, 100, 100)
DCEI.SetBackgroundImage(frame, "airship_onMap")
DCEI.SetBackgroundImageFillAmount(frame, 0.5)
DCEI.SetBackgroundImageFillVertical(frame)
- SetBackgroundImageFillAmount()
- GetBackgroundImageFillAmount()
- SetBackgroundImageFillHorizontal()
- SetBackgroundImageFillRadial()
- SetBackgroundImageFillOrigin()
- SetBackgroundImageFillAmountExpression()
- AnimateBackgroundImageFillAmount()
void SetFrameImageFillRadial(Transform ui)
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.
local frame = DCEI.NewFrame(DCEI.GetUiRoot())
DCEI.SetSize(frame, 100, 100)
DCEI.SetBackgroundImage(frame, "airship_onMap")
DCEI.SetBackgroundImageFillAmount(frame, 0.75)
DCEI.SetBackgroundImageFillRadial(frame)
- SetBackgroundImageFillAmount()
- GetBackgroundImageFillAmount()
- SetBackgroundImageFillHorizontal()
- SetBackgroundImageFillVertical()
- SetBackgroundImageFillOrigin()
- SetBackgroundImageFillAmountExpression()
- AnimateBackgroundImageFillAmount()
void SetFrameImageFillOrigin(Transform ui, int origin) {void-SetFrameImageFillOriginTransform-ui-int-origin}
void SetFrameImageFillOrigin(Transform ui, int origin)
Sets the fill progress orientation of a UI frame.
-
Transform
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])
local countdown = DCEI.NewFrame(DCEI.GetUiRoot())
DCEI.SetBackgroundImage(countdown, "circle01")
DCEI.SetSize(countdown, 128, 128)
DCEI.SetBackgroundImageFillRadial(countdown)
DCEI.SetBackgroundImageFillOrigin(countdown, 1)
DCEI.SetBackgroundImageFillAmount(countdown, 0.75)