Skip to content

Trigger API Reference DCEI Functions Custom UI3

BlackTower edited this page Aug 15, 2022 · 31 revisions
Table of Contents
- [Trigger API Reference\DCEI Functions\Custom UI (4/8)](#trigger-api-referencedcei-functionscustom-ui-48) * [void SetTextFrameShadowDirection(Transform text, float x, float y)](#void-settextframeshadowdirectiontransform-text-float-x-float-y) * [string GetInputFrameText(Transform text)](#string-getinputframetexttransform-text) * [void SetInputFrameText(Transform text, string content)](#void-setinputframetexttransform-text-string-content) * [void SetInputFrameFontSize(Transform text, float size)](#void-setinputframefontsizetransform-text-float-size) * [void SetInputFrameColor(Transform text, ColorRGB color)](#void-setinputframecolortransform-text-colorrgb-color) * [void SetInputFrameColorRGB(Transform text, ColorRGB color)](#void-setinputframecolorrgbtransform-text-colorrgb-color) * [void SetInputFrameWrapping(Transform text, bool enable)](#void-setinputframewrappingtransform-text-bool-enable) * [void SetInputFramePlaceholder(Transform text, string content)](#void-setinputframeplaceholdertransform-text-string-content) * [void SetInputFramePlaceholderFontSize(Transform text, float size)](#void-setinputframeplaceholderfontsizetransform-text-float-size) * [void SetInputFramePlaceholderColor(Transform text, ColorRGB color)](#void-setinputframeplaceholdercolortransform-text-colorrgb-color) * [void SetInputFramePlaceholderColorRGB(Transform text, ColorRGB color)](#void-setinputframeplaceholdercolorrgbtransform-text-colorrgb-color) * [void SetInputFramePlaceholderOutline(Transform text, bool outline)](#void-setinputframeplaceholderoutlinetransform-text-bool-outline) * [void SetUserInputTextFrameText(Transform text, string content)](#void-setuserinputtextframetexttransform-text-string-content) * [void SetUserInputTextFrameFontSize(Transform text, float size)](#void-setuserinputtextframefontsizetransform-text-float-size) * [void SetUserInputTextFrameColor(Transform text, ColorRGB color)](#void-setuserinputtextframecolortransform-text-colorrgb-color) * [void SetUserInputTextFrameColorRGB(Transform text, ColorRGB color)](#void-setuserinputtextframecolorrgbtransform-text-colorrgb-color) * [void SetUserInputTextFrameWrapping(Transform text, bool enable)](#void-setuserinputtextframewrappingtransform-text-bool-enable) * [void SetFrameMinSize(Transform ui, float width, float height)](#void-setframeminsizetransform-ui-float-width-float-height) * [void SetFrameMinWidth(Transform ui, float width)](#void-setframeminwidthtransform-ui-float-width) * [void SetFrameMinHeight(Transform ui, float height)](#void-setframeminheighttransform-ui-float-height) * [void SetFrameMaxSize(Transform ui, float width, float height)](#void-setframemaxsizetransform-ui-float-width-float-height) * [void SetFrameMaxWidth(Transform ui, float width)](#void-setframemaxwidthtransform-ui-float-width) * [void SetFrameMaxHeight(Transform ui, float height)](#void-setframemaxheighttransform-ui-float-height) * [void SetFrameSize(Transform ui, float width, float height)](#void-setframesizetransform-ui-float-width-float-height) * [void SetFrameWidth(Transform ui, float width)](#void-setframewidthtransform-ui-float-width) * [void SetFrameHeight(Transform ui, float height)](#void-setframeheighttransform-ui-float-height) * [void FlipFrameHorizontal(Transform ui)](#void-flipframehorizontaltransform-ui) * [void FlipFrameVertical(Transform ui)](#void-flipframeverticaltransform-ui) * [void SetFrameMatchParent(Transform ui, bool matchWidth, bool matchHeight)](#void-setframematchparenttransform-ui-bool-matchwidth-bool-matchheight) * [void SetFramePadding(Transform ui, float padding)](#void-setframepaddingtransform-ui-float-padding)

Trigger API Reference\DCEI Functions\Custom UI (4/8) {Trigger-API-ReferenceDCEI-FunctionsCustom-UI-48}

See Also

void SetTextFrameShadowDirection(Transform text, float x, float y) {void-SetTextFrameShadowDirectionTransform-text-float-x-float-y}

void SetTextFrameShadowDirection(Transform text, float x, float y)

Description

Sets the direction for a text frame's text shadow. The coordinate's direction is based on the unit circle. The magnitude of the offset has a small effect on the shadow length.

Parameters

  • Transform text the text frame.
  • float x the X coordinate.
  • float y the Y coordinate.

Example Usage

local frame = DCEI.NewFrame(DCEI.GetUiRoot())
DCEI.SetBackgroundImageColor(frame, 1, 1, 0, 0.5)

local text_frame = DCEI.NewText(frame)
DCEI.SetText(text_frame, "Text")
DCEI.SetSize(text_frame, 200, 100)
DCEI.SetTextFontSize(text_frame, 50)
DCEI.SetTextShadowDirection(text_frame, 100, 100)

Related

string GetInputFrameText(Transform text) {string-GetInputFrameTextTransform-text}

string GetInputFrameText(Transform text)

Description

Returns the text entered into an input text frame.

Parameters

  • Transform text the input frame.

Example Usage

local input_frame = DCEI.NewInput(DCEI.GetUiRoot())
DCEI.SetSize(input_frame, 100, 50)
DCEI.SetInputText(input_frame, "Input Frame")

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

Related

void SetInputFrameText(Transform text, string content) {void-SetInputFrameTextTransform-text-string-content}

void SetInputFrameText(Transform text, string content)

Description

Sets the text for an input frame.

Parameters

  • Transform text the input frame.
  • string content the text to set.

Example Usage

local input_frame = DCEI.NewInput(DCEI.GetUiRoot())
DCEI.SetSize(input_frame, 100, 50)
DCEI.SetInputText(input_frame, "Input Frame")

Related

void SetInputFrameFontSize(Transform text, float size) {void-SetInputFrameFontSizeTransform-text-float-size}

void SetInputFrameFontSize(Transform text, float size)

Description

Sets the text size for an input frame.

Parameters

  • Transform text the input frame.
  • float size the new text size.

Example Usage

local input_frame = DCEI.NewInput(DCEI.GetUiRoot())
DCEI.SetSize(input_frame, 100, 50)
DCEI.SetInputText(input_frame, "Input Frame")
DCEI.SetInputTextFontSize(input_frame, 50)

Related

void SetInputFrameColor(Transform text, ColorRGB color) {void-SetInputFrameColorTransform-text-ColorRGB-color}

void SetInputFrameColor(Transform text, ColorRGB color)

Description

Sets the text color for an input frame.

Parameters

  • Transform text the input frame.
  • ColorRGB color the RGB values for the line.

Example Usage

local input_frame = DCEI.NewInput(DCEI.GetUiRoot())
DCEI.SetSize(input_frame, 100, 50)
DCEI.SetInputText(input_frame, "Input Frame")
DCEI.SetInputFrameColor(input_frame, {r = 0.5, g = 0.5, b = 0})

Related

void SetInputFrameColorRGB(Transform text, ColorRGB color) {void-SetInputFrameColorRGBTransform-text-ColorRGB-color}

void SetInputFrameColorRGB(Transform text, ColorRGB color)

Description

Sets the text color for an input frame.

Parameters

  • Transform text the input frame.
  • ColorRGB color the RGB values for the line.

Example Usage

local input_frame = DCEI.NewInput(DCEI.GetUiRoot())
DCEI.SetSize(input_frame, 100, 50)
DCEI.SetInputText(input_frame, "Input Frame")
DCEI.SetInputFrameColorRGB(input_frame, {r = 0.5, g = 0.5, b = 0})

Related

void SetInputFrameWrapping(Transform text, bool enable) {void-SetInputFrameWrappingTransform-text-bool-enable}

void SetInputFrameWrapping(Transform text, bool enable)

Description

Sets text wrapping for an input frame.

Parameters

  • Transform 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.NewInput(DCEI.GetUiRoot())
DCEI.SetSize(input_frame, 100, 50)
DCEI.SetInputText(input_frame, "Input Frame Wrapping Test")
DCEI.SetInputTextWrapping(input_frame, true)

Related

void SetInputFramePlaceholder(Transform text, string content) {void-SetInputFramePlaceholderTransform-text-string-content}

void SetInputFramePlaceholder(Transform text, string content)

Description

Sets the text placeholder for an input frame.

Parameters

  • Transform text the input frame.
  • string content the text placeholder to set.

Example Usage

local input_frame = DCEI.NewInput(DCEI.GetUiRoot())
DCEI.SetSize(input_frame, 100, 50)
DCEI.SetInputPlaceholder(input_frame, "Edit me")

Related

void SetInputFramePlaceholderFontSize(Transform text, float size) {void-SetInputFramePlaceholderFontSizeTransform-text-float-size}

void SetInputFramePlaceholderFontSize(Transform text, float size)

Description

Sets the placeholder text size for an input frame.

Parameters

  • Transform text the input frame.
  • float size the font size.

Example Usage

local input_frame = DCEI.NewInput(DCEI.GetUiRoot())
DCEI.SetSize(input_frame, 100, 50)
DCEI.SetInputPlaceholder(input_frame, "Input Placeholder")
DCEI.SetInputPlaceholderFontSize(input_frame, 50)

Related

void SetInputFramePlaceholderColor(Transform text, ColorRGB color) {void-SetInputFramePlaceholderColorTransform-text-ColorRGB-color}

void SetInputFramePlaceholderColor(Transform text, ColorRGB color)

Description

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

Parameters

  • Transform text the text frame.
  • ColorRGB color the RGB values for the line.

Example Usage

local input_frame = DCEI.NewInput(DCEI.GetUiRoot())
DCEI.SetSize(input_frame, 100, 50)
DCEI.SetInputPlaceholder(input_frame, "Input Placeholder")
DCEI.SetInputFramePlaceholderColor(input_frame, {r = 0.5, g = 0.5, b = 0})

Related

void SetInputFramePlaceholderColorRGB(Transform text, ColorRGB color) {void-SetInputFramePlaceholderColorRGBTransform-text-ColorRGB-color}

void SetInputFramePlaceholderColorRGB(Transform text, ColorRGB color)

Description

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

Parameters

  • Transform text the text frame.
  • ColorRGB color the RGB values for the line.

Example Usage

local input_frame = DCEI.NewInput(DCEI.GetUiRoot())
DCEI.SetSize(input_frame, 100, 50)
DCEI.SetInputPlaceholder(input_frame, "Input Placeholder")
DCEI.SetInputFramePlaceholderColorRGB(input_frame, {r = 0.5, g = 0.5, b = 0})

Related

void SetInputFramePlaceholderOutline(Transform text, bool outline) {void-SetInputFramePlaceholderOutlineTransform-text-bool-outline}

void SetInputFramePlaceholderOutline(Transform text, bool outline)

Description

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

Parameters

  • Transform 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.NewInput(DCEI.GetUiRoot())
DCEI.SetSize(input_frame, 100, 50)
DCEI.SetInputPlaceholder(input_frame, "Input Placeholder")
DCEI.SetInputPlaceholderOutline(input_frame, true)

Related

void SetUserInputTextFrameText(Transform text, string content) {void-SetUserInputTextFrameTextTransform-text-string-content}

void SetUserInputTextFrameText(Transform text, string content)

Description

Sets the text for a user input text frame.

Parameters

  • Transform text the user input text frame.
  • string content the text to set.

Example Usage

local vstack = DCEI.NewVStack(DCEI.GetUiRoot())
local input_frame = DCEI.NewInput(vstack)
DCEI.SetInputText(input_frame, "Input Frame")
DCEI.SetSize(input_frame, 300, 50)

local input = DCEI.GetInputText(input_frame)

local user_input = DCEI.NewUserInputText(vstack)
DCEI.SetSize(user_input, 300, 50)
DCEI.SetBackgroundImageColor(user_input, 1, 0, 1, 0.4)
DCEI.SetUserInputText(user_input, input)

Related

void SetUserInputTextFrameFontSize(Transform text, float size) {void-SetUserInputTextFrameFontSizeTransform-text-float-size}

void SetUserInputTextFrameFontSize(Transform text, float size)

Description

Sets the text size for a user input text frame.

Parameters

  • Transform text the user input text frame.
  • float size the new text size.

Example Usage

local user_input = DCEI.NewUserInputText(DCEI.GetUiRoot())
DCEI.SetBackgroundImageColor(user_input, 1, 0, 0, 0.5)
DCEI.SetSize(user_input, 400, 100)
DCEI.SetUserInputText(user_input, "User Input Text")
DCEI.SetUserInputTextFontSize(user_input, 50)

Related

void SetUserInputTextFrameColor(Transform text, ColorRGB color) {void-SetUserInputTextFrameColorTransform-text-ColorRGB-color}

void SetUserInputTextFrameColor(Transform text, ColorRGB color)

Description

Sets the text color for a user input text frame.

Parameters

  • Transform text the text frame.
  • ColorRGB color the RGB values for the line.

Example Usage

local user_input = DCEI.NewUserInputText(DCEI.GetUiRoot())
DCEI.SetBackgroundImageColor(user_input, 1, 0, 0, 0.5)
DCEI.SetSize(user_input, 400, 100)
DCEI.SetUserInputText(user_input, "User Input Text")
DCEI.SetUserInputTextFontSize(user_input, 50)
DCEI.SetUserInputTextFrameColor(user_input, {r = 0.5, g = 0.5, b = 0})

Related

void SetUserInputTextFrameColorRGB(Transform text, ColorRGB color) {void-SetUserInputTextFrameColorRGBTransform-text-ColorRGB-color}

void SetUserInputTextFrameColorRGB(Transform text, ColorRGB color)

Description

Sets the text color for a user input text frame.

Parameters

  • Transform text the text frame.
  • ColorRGB color the RGB values for the line.

Example Usage

local user_input = DCEI.NewUserInputText(DCEI.GetUiRoot())
DCEI.SetBackgroundImageColor(user_input, 1, 0, 0, 0.5)
DCEI.SetSize(user_input, 400, 100)
DCEI.SetUserInputText(user_input, "User Input Text")
DCEI.SetUserInputTextFontSize(user_input, 50)
DCEI.SetUserInputTextFrameColorRGB(user_input, {r = 0.5, g = 0.5, b = 0})

Related

void SetUserInputTextFrameWrapping(Transform text, bool enable) {void-SetUserInputTextFrameWrappingTransform-text-bool-enable}

void SetUserInputTextFrameWrapping(Transform text, bool enable)

Description

Sets text wrapping for a user input text frame.

Parameters

  • Transform 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.NewUserInputText(DCEI.GetUiRoot())
DCEI.SetBackgroundImageColor(user_input, 1, 0, 0, 0.5)
DCEI.SetSize(user_input, 200, 100)
DCEI.SetUserInputText(user_input, "User Input Text")
DCEI.SetUserInputTextFontSize(user_input, 50)
DCEI.SetUserInputTextWrapping(user_input, true)

Related

void SetFrameMinSize(Transform ui, float width, float height) {void-SetFrameMinSizeTransform-ui-float-width-float-height}

void SetFrameMinSize(Transform 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

  • Transform 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.NewFrame(DCEI.GetUiRoot())
DCEI.SetMinSize(frame, 100, 100)
DCEI.SetBackgroundImageColor(frame, 0, 0, 1, 0.5)

void SetFrameMinWidth(Transform ui, float width) {void-SetFrameMinWidthTransform-ui-float-width}

void SetFrameMinWidth(Transform 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

  • Transform ui the frame to adjust.
  • float width the new minimum width of the frame.

Example Usage

local frame = DCEI.NewFrame(DCEI.GetUiRoot())
DCEI.SetFrameMinWidth(frame, 100)
DCEI.SetBackgroundImageColor(frame, 0, 0, 1, 0.5)

void SetFrameMinHeight(Transform ui, float height) {void-SetFrameMinHeightTransform-ui-float-height}

void SetFrameMinHeight(Transform 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

  • Transform ui the frame to adjust.
  • float height the new minimum height of the frame.

Example Usage

local frame = DCEI.NewFrame(DCEI.GetUiRoot())
DCEI.SetFrameMinHeight(frame, 100)
DCEI.SetBackgroundImageColor(frame, 0, 0, 1, 0.5)

void SetFrameMaxSize(Transform ui, float width, float height) {void-SetFrameMaxSizeTransform-ui-float-width-float-height}

void SetFrameMaxSize(Transform 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 text frames to create dynamic text scaling (with DCEI.SetTextFontSizeMin/DCEI.SetTextFontSizeMax).

Parameters

  • Transform 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.NewText(DCEI.GetUiRoot())
DCEI.SetMaxSize(label, 100, 48)

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

void SetFrameMaxWidth(Transform ui, float width) {void-SetFrameMaxWidthTransform-ui-float-width}

void SetFrameMaxWidth(Transform 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

  • Transform ui the frame to adjust.
  • float width the new maximum width of the frame.

Example Usage

local frame = DCEI.NewFrame(DCEI.GetUiRoot())
DCEI.SetFrameMinWidth(frame, 100)
DCEI.SetBackgroundImageColor(frame, 0, 0, 1, 0.5)

void SetFrameMaxHeight(Transform ui, float height) {void-SetFrameMaxHeightTransform-ui-float-height}

void SetFrameMaxHeight(Transform 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

  • Transform ui the frame to adjust.
  • float height the new maximum height of the frame.

Example Usage

local frame = DCEI.NewFrame(DCEI.GetUiRoot())
DCEI.SetFrameMaxHeight(frame, 100)
DCEI.SetBackgroundImageColor(frame, 0, 0, 1, 0.5)

void SetFrameSize(Transform ui, float width, float height) {void-SetFrameSizeTransform-ui-float-width-float-height}

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

Description

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

Parameters

  • Transform 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.NewFrame(DCEI.GetUiRoot())
DCEI.SetSize(frame, 100, 100)
DCEI.SetBackgroundImageColor(frame, 0, 0, 1, 0.5)

void SetFrameWidth(Transform ui, float width) {void-SetFrameWidthTransform-ui-float-width}

void SetFrameWidth(Transform ui, float width)

Description

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

Parameters

  • Transform ui the frame to adjust.
  • float width the new width of the frame.

Example Usage

local frame = DCEI.NewFrame(DCEI.GetUiRoot())
DCEI.SetFrameWidth(frame, 100)

void SetFrameHeight(Transform ui, float height) {void-SetFrameHeightTransform-ui-float-height}

void SetFrameHeight(Transform ui, float height)

Description

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

Parameters

  • Transform ui the frame to adjust.
  • float height the new height of the frame.

Example Usage

local frame = DCEI.NewFrame(DCEI.GetUiRoot())
DCEI.SetFrameHeight(frame, 100)

void FlipFrameHorizontal(Transform ui) {void-FlipFrameHorizontalTransform-ui}

void FlipFrameHorizontal(Transform ui)

Description

Flips the given UI frame and its children horizontally. Does not work on the root UI.

Parameters

  • Transform ui the UI frame to flip.

Example Usage

local frame = DCEI.NewFrame(DCEI.GetUiRoot())
DCEI.SetBackgroundImage(frame, "airship_onMap")
DCEI.UseImageSizeRatio(frame, 1)
DCEI.FlipHorizontal(frame)

void FlipFrameVertical(Transform ui) {void-FlipFrameVerticalTransform-ui}

void FlipFrameVertical(Transform ui)

Description

Flips the given UI frame and its children vertically. Does not work on the root UI.

Parameters

  • Transform ui the UI frame to flip.

Example Usage

local frame = DCEI.NewFrame(DCEI.GetUiRoot())
DCEI.SetBackgroundImage(frame, "airship_onMap")
DCEI.UseImageSizeRatio(frame, 1)
DCEI.FlipVertical(frame)

void SetFrameMatchParent(Transform ui, bool matchWidth, bool matchHeight) {void-SetFrameMatchParentTransform-ui-bool-matchWidth-bool-matchHeight}

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

Description

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

Parameters

  • Transform ui the frame to adjust.
  • boolean matchWidth whether to set the frame's width to that of its parent.
  • boolean matchHeight whether to set the frame's height to that of its parent.

Example Usage

local fullscreen_mask = DCEI.NewFrame(DCEI.GetUiRoot())

DCEI.SetMatchParent(fullscreen_mask, true, true)
DCEI.SetBackgroundImageColor(fullscreen_mask, 0, 0, 0, 0.5)

void SetFramePadding(Transform ui, float padding) {void-SetFramePaddingTransform-ui-float-padding}

void SetFramePadding(Transform ui, float padding)

Description

Sets the padding for a UI frame.

Parameters

  • Transform ui the frame to set padding for.
  • float padding the padding to set.

Example Usage

local frame1 = DCEI.NewFrame(DCEI.GetUiRoot())
DCEI.SetBackgroundImageColor(frame1, 1, 0, 1, 0.4)
DCEI.SetPadding(frame1, 20)

local frame2 = DCEI.NewFrame(frame1)
DCEI.SetSize(frame2, 100, 100)
DCEI.SetBackgroundImageColor(frame2, 0, 1, 1, 0.4)

Clone this wiki locally