Trigger API Reference DCEI Functions Custom UI1 - BLKTower/TestWiki GitHub Wiki

Table of Contents

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

See Also

int GetChildrenFrameCount(Transform parent) {int-GetChildrenFrameCountTransform-parent}

int GetChildrenFrameCount(Transform parent)

Description

Returns the number of child frames.

Parameters

  • 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.

Example Usage

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) {Transform-CreateButtonFrameTransform-parent}

Transform CreateButtonFrame(Transform parent)

Description

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.

Parameters

  • Transform parent the parent UI frame.

Example Usage

local button = DCEI.NewButton(DCEI.GetUiRoot())
DCEI.SetSize(button, 120, 50)

Related

Transform CreateTextFrame(Transform parent) {Transform-CreateTextFrameTransform-parent}

Transform CreateTextFrame(Transform parent)

Description

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

Parameters

  • Transform parent the parent UI frame.

Example Usage

local text = DCEI.NewText(button)
DCEI.SetText(text, "Button")

Related

Transform CreateUserInputTextFrame(Transform parent) {Transform-CreateUserInputTextFrameTransform-parent}

Transform CreateUserInputTextFrame(Transform 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

  • Transform parent the parent UI frame.

Example Usage

local input_text = DCEI.NewUserInputText(DCEI.GetUiRoot())
DCEI.SetSize(input_text, 200, 50)
DCEI.SetUserInputText(input_text, "pretend I'm user input text")

Related

Transform CreateInputFrame(Transform parent) {Transform-CreateInputFrameTransform-parent}

Transform CreateInputFrame(Transform parent)

Description

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

Parameters

  • Transform parent the parent UI frame.

Example Usage

local input = DCEI.NewInput(DCEI.GetUiRoot())
DCEI.SetSize(input, 300, 50)

Related

Transform CreateFrameFromXml(Transform parent, string name) {Transform-CreateFrameFromXmlTransform-parent-string-name}

Transform CreateFrameFromXml(Transform parent, string name)

Description

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

Parameters

  • Transform 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.NewUiFromXml(DCEI.GetUiRoot(), "MyCustomUi")

Related

void UpdateFrame(Transform ui, object callback) {void-UpdateFrameTransform-ui-object-callback}

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

  • Transform ui the UI frame to update.
  • object callback the callback function to run.

Example Usage

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) {object-GetFrameStateTransform-ui}

object GetFrameState(Transform 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

  • Transform ui the UI frame to get the state of.

Example Usage

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)

Description

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

Parameters

  • Transform ui the parent XML UI frame.
  • string id the type of the child UI frame.

Example Usage

local parent = DCEI.NewUiFromXml(DCEI.GetUiRoot(), "MyCustomUi")
local background_frame = DCEI.FindXmlUiById(parent, "Background")

object GetXmlFrames() {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

local xml_frames = DCEI.GetXmlFrames()

object GetChildrenFramesIdAndFrameType(Transform ui) {object-GetChildrenFramesIdAndFrameTypeTransform-ui}

object GetChildrenFramesIdAndFrameType(Transform ui)

Description

Returns a table of child XML UI frames.

Parameters

  • Transform ui the parent XML UI frame.

Example Usage

local parent = DCEI.NewUiFromXml(DCEI.GetUiRoot(), "MyCustomUi")
local child_frames = DCEI.GetXmlUiChildrenFrames(parent)

bool IsUiRootFrame(Transform ui) {bool-IsUiRootFrameTransform-ui}

bool IsUiRootFrame(Transform ui)

Description

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

Parameters

  • Transform ui the XMl UI frame to check.

Example Usage

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)

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

  • 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.

Example Usage

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
)

Related

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)

Description

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

Parameters

  • 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.

Example Usage

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
)

Related

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)

Description

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

Parameters

  • 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.

Example Usage

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
)

Related

void SetGridFrameCellWidth(Transform ui, float width) {void-SetGridFrameCellWidthTransform-ui-float-width}

void SetGridFrameCellWidth(Transform ui, float width)

Description

Sets the cell width for a grid.

Parameters

  • Transform ui the grid UI frame.
  • float width the width of a grid cell.

Example Usage

DCEI.SetGridCellWidth(test, 100)

Related

void SetGridFrameCellHeight(Transform ui, float height) {void-SetGridFrameCellHeightTransform-ui-float-height}

void SetGridFrameCellHeight(Transform ui, float height)

Description

Sets the cell height for a grid.

Parameters

  • Transform ui the grid UI frame.
  • float height the height of a grid cell.

Example Usage

DCEI.SetGridCellHeight(test, 100)

Related

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)

Description

Animates a camera frame UI to a new position. Returns the UI animation for use in SetAnimationLoops() and StopAnimationLoops().

Parameters

  • 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
    

Example Usage

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
)

Related

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)

Description

Animates a camera frame UI to a new rotation. Returns the UI animation for use in SetAnimationLoops() and StopAnimationLoops().

Parameters

  • 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
    

Example Usage

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
)

Related

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)

Description

Animates a camera frame UI to a new orthographic size. Returns the UI animation for use in SetAnimationLoops() and StopAnimationLoops().

Parameters

  • 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
    

Example Usage

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")

Related

void SetCameraFrameCullingMask(Transform ui, int mask) {void-SetCameraFrameCullingMaskTransform-ui-int-mask}

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

  • Transform 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, "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)

Related

void SetCameraFrameBackgroundColor(Transform ui, ColorRGBA color) {void-SetCameraFrameBackgroundColorTransform-ui-ColorRGBA-color}

void SetCameraFrameBackgroundColor(Transform ui, ColorRGBA color)

Description

Parameters

Example Usage

void SetCameraFrameBackgroundColorRGBA(Transform ui, ColorRGBA color) {void-SetCameraFrameBackgroundColorRGBATransform-ui-ColorRGBA-color}

void SetCameraFrameBackgroundColorRGBA(Transform ui, ColorRGBA color)

⚠️Warning⚠️: This api was deprecated at 7/19/2022, and will be removed after 90 days.

Description

Parameters

Example Usage

void SetCameraFrameViewportOrthographic(Transform ui, bool set) {void-SetCameraFrameViewportOrthographicTransform-ui-bool-set}

void SetCameraFrameViewportOrthographic(Transform ui, bool set)

Description

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

Parameters

  • Transform ui the camera frame.
  • bool set if true, enables orthographic view.

Example Usage

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)

Related

void SetCameraFrameOrthographicViewportSize(Transform ui, float size) {void-SetCameraFrameOrthographicViewportSizeTransform-ui-float-size}

void SetCameraFrameOrthographicViewportSize(Transform ui, float size)

Description

Sets the orthographic size for a camera frame.

Parameters

  • Transform ui the camera frame.
  • float size the orthographic size.

Example Usage

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
)

Related

Transform CreateMiniMapFrame(Transform parent, bool hideTerrain) {Transform-CreateMiniMapFrameTransform-parent-bool-hideTerrain}

Transform CreateMiniMapFrame(Transform parent, bool hideTerrain)

Description

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

Parameters

  • Transform parent the parent frame.
  • bool hideTerrain if true, hides the terrain.

Example Usage

local minimap = DCEI.NewMiniMapFrame(DCEI.GetUiRoot(), false)
DCEI.SetCameraFrameSize(minimap, 500, 500, true)
DCEI.SetSize(minimap, 200, 200)

Related

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)

Description

Parameters

Example Usage

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)

⚠️Warning⚠️: This api was deprecated at 7/19/2022, and will be removed after 90 days.

Description

Parameters

Example Usage

Transform GetScrollFrameContent(Transform parent) {Transform-GetScrollFrameContentTransform-parent}

Transform GetScrollFrameContent(Transform parent)

Description

Returns the content frame of a scroll frame.

Parameters

  • Transform parent the scroll frame.

Example Usage

local scroll = DCEI.NewScroll(DCEI.GetUiRoot())
local content = DCEI.GetScrollContent(scroll)

Related

void SetScrollFrameScrollPosition(Transform ui, float position) {void-SetScrollFrameScrollPositionTransform-ui-float-position}

void SetScrollFrameScrollPosition(Transform ui, float position)

Description

Sets the scroll position for an HScroll or VScroll frames.

Parameters

  • Transform ui the scroll frame (not the scroll content frame).
  • float position the offset to set the scroll to.

Example Usage

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)

Related

⚠️ **GitHub.com Fallback** ⚠️