Class TreeItem

Namespace
Forma
Assembly
Forma.dll

One hierarchical row owned by a Tree.

public sealed class TreeItem
Inheritance
TreeItem
Inherited Members

Properties

Children

public IReadOnlyList<TreeItem> Children { get; }

Property Value

IReadOnlyList<TreeItem>

Collapsed

public bool Collapsed { get; }

Property Value

bool

Depth

public int Depth { get; }

Property Value

int

Editable

Legacy first-column editing projection. Prefer SetEditable(int, bool).

public bool Editable { get; set; }

Property Value

bool

IsSelected

Convenience projection indicating whether any selectable cell in this item is selected.

public bool IsSelected { get; }

Property Value

bool

Metadata

Convenience alias for first-column metadata. Prefer SetMetadata(int, object) for Godot-compatible per-cell state.

public object Metadata { get; set; }

Property Value

object

Parent

public TreeItem Parent { get; }

Property Value

TreeItem

Selectable

Convenience alias for whether the first column can be selected.

public bool Selectable { get; set; }

Property Value

bool

Text

Convenience alias for the first column's text.

public string Text { get; set; }

Property Value

string

Visible

Whether this item participates in the rendered and navigable tree, matching Godot's visible property.

public bool Visible { get; }

Property Value

bool

Methods

AddButton(int, Texture2D, int, bool, string, string)

public void AddButton(int column, Texture2D button, int id = -1, bool disabled = false, string tooltip = "", string description = "")

Parameters

column int
button Texture2D
id int
disabled bool
tooltip string
description string

ClearButtons()

Removes every action button from this item, matching Godot's clear_buttons().

public void ClearButtons()

ClearChildren()

Removes every direct child and its retained subtree from this item's visible hierarchy, matching Godot's clear_children().

public void ClearChildren()

ClearCustomBackgroundColor(int)

public void ClearCustomBackgroundColor(int column)

Parameters

column int

ClearCustomColor(int)

public void ClearCustomColor(int column)

Parameters

column int

CreateChild(int)

public TreeItem CreateChild(int index = -1)

Parameters

index int

Returns

TreeItem

Deselect(int)

Deselects this cell, matching Godot's TreeItem.deselect().

public void Deselect(int column = 0)

Parameters

column int

EraseButton(int, int)

Removes one action button, matching Godot's erase_button().

public void EraseButton(int column, int index)

Parameters

column int
index int

GetButton(int, int)

Compatibility alias for Godot's get_button().

public Texture2D GetButton(int column, int index)

Parameters

column int
index int

Returns

Texture2D

GetButtonById(int, int)

public int GetButtonById(int column, int id)

Parameters

column int
id int

Returns

int

GetButtonColor(int, int)

public Color GetButtonColor(int column, int index)

Parameters

column int
index int

Returns

Color

GetButtonCount(int)

public int GetButtonCount(int column)

Parameters

column int

Returns

int

GetButtonDescription(int, int)

public string GetButtonDescription(int column, int index)

Parameters

column int
index int

Returns

string

GetButtonId(int, int)

public int GetButtonId(int column, int index)

Parameters

column int
index int

Returns

int

GetButtonTexture(int, int)

public Texture2D GetButtonTexture(int column, int index)

Parameters

column int
index int

Returns

Texture2D

GetButtonTooltipText(int, int)

public string GetButtonTooltipText(int column, int index)

Parameters

column int
index int

Returns

string

GetCellMode(int)

public TreeCellMode GetCellMode(int column)

Parameters

column int

Returns

TreeCellMode

GetChild(int)

public TreeItem GetChild(int index)

Parameters

index int

Returns

TreeItem

GetChildCount()

public int GetChildCount()

Returns

int

GetCustomBackgroundColor(int)

public Color? GetCustomBackgroundColor(int column)

Parameters

column int

Returns

Color?

GetCustomColor(int)

public Color? GetCustomColor(int column)

Parameters

column int

Returns

Color?

GetCustomDrawCallback(int)

public TreeItemCustomDrawCallback GetCustomDrawCallback(int column)

Parameters

column int

Returns

TreeItemCustomDrawCallback

GetCustomFont(int)

public SpriteFont GetCustomFont(int column)

Parameters

column int

Returns

SpriteFont

GetCustomFontSize(int)

public int GetCustomFontSize(int column)

Parameters

column int

Returns

int

GetCustomMinimumHeight()

Returns this row's custom minimum height, or zero when it uses the Tree default.

public int GetCustomMinimumHeight()

Returns

int

GetCustomStyleBox(int)

public StyleBox GetCustomStyleBox(int column)

Parameters

column int

Returns

StyleBox

GetCustomUIFont(int)

public UIFont GetCustomUIFont(int column)

Parameters

column int

Returns

UIFont

GetDescription(int)

public string GetDescription(int column)

Parameters

column int

Returns

string

GetDisplayText(int)

Gets the textual projection drawn for this cell, including a range value and suffix.

public string GetDisplayText(int column)

Parameters

column int

Returns

string

Remarks

Godot computes this value internally while updating its shaped text buffer; this retained inspection helper makes the renderer contract deterministic.

GetExpandRight(int)

public bool GetExpandRight(int column)

Parameters

column int

Returns

bool

GetFirstChild()

public TreeItem GetFirstChild()

Returns

TreeItem

GetIcon(int)

public Texture2D GetIcon(int column)

Parameters

column int

Returns

Texture2D

GetIconMaxWidth(int)

public int GetIconMaxWidth(int column)

Parameters

column int

Returns

int

GetIconModulate(int)

public Color GetIconModulate(int column)

Parameters

column int

Returns

Color

GetIconOverlay(int)

public Texture2D GetIconOverlay(int column)

Parameters

column int

Returns

Texture2D

GetIconRegion(int)

public Rectangle? GetIconRegion(int column)

Parameters

column int

Returns

Rectangle?

GetIndex()

public int GetIndex()

Returns

int

GetLanguage(int)

public string GetLanguage(int column)

Parameters

column int

Returns

string

GetLastChild()

public TreeItem GetLastChild()

Returns

TreeItem

GetMetadata(int)

public object GetMetadata(int column)

Parameters

column int

Returns

object

GetNext()

Returns this item's next sibling, matching Godot's get_next().

public TreeItem GetNext()

Returns

TreeItem

GetNextInTree(bool)

Returns the next item in complete preorder hierarchy, including collapsed and invisible descendants.

public TreeItem GetNextInTree(bool wrap = false)

Parameters

wrap bool

Returns

TreeItem

GetNextVisible(bool)

Returns the next rendered item, optionally wrapping to the first visible item.

public TreeItem GetNextVisible(bool wrap = false)

Parameters

wrap bool

Returns

TreeItem

GetParent()

public TreeItem GetParent()

Returns

TreeItem

GetPrevious()

Returns this item's previous sibling, matching Godot's get_prev().

public TreeItem GetPrevious()

Returns

TreeItem

GetPreviousInTree(bool)

Returns the previous item in complete preorder hierarchy, including collapsed and invisible descendants.

public TreeItem GetPreviousInTree(bool wrap = false)

Parameters

wrap bool

Returns

TreeItem

GetPreviousVisible(bool)

Returns the previous rendered item, optionally wrapping to the last visible item.

public TreeItem GetPreviousVisible(bool wrap = false)

Parameters

wrap bool

Returns

TreeItem

GetRange(int)

public float GetRange(int column)

Parameters

column int

Returns

float

GetRangeConfig(int, out float, out float, out float)

public void GetRangeConfig(int column, out float minimum, out float maximum, out float step)

Parameters

column int
minimum float
maximum float
step float

GetRangeMaximum(int)

public float GetRangeMaximum(int column)

Parameters

column int

Returns

float

GetRangeMinimum(int)

public float GetRangeMinimum(int column)

Parameters

column int

Returns

float

GetSuffix(int)

public string GetSuffix(int column)

Parameters

column int

Returns

string

GetText(int)

public string GetText(int column)

Parameters

column int

Returns

string

GetTextAlignment(int)

public HorizontalAlignment GetTextAlignment(int column)

Parameters

column int

Returns

HorizontalAlignment

GetTextDirection(int)

public TextDirection GetTextDirection(int column)

Parameters

column int

Returns

TextDirection

GetTooltipText(int)

public string GetTooltipText(int column)

Parameters

column int

Returns

string

GetTree()

public Tree GetTree()

Returns

Tree

GetVisibleChildCount()

Returns the number of directly visible children, matching Godot's get_visible_child_count().

public int GetVisibleChildCount()

Returns

int

IsAcceptingChildren()

public bool IsAcceptingChildren()

Returns

bool

IsAnyCollapsed(bool)

Returns whether this subtree contains a collapsed item with children.

public bool IsAnyCollapsed(bool onlyVisible = false)

Parameters

onlyVisible bool

Returns

bool

IsAnyColumnSelected()

Returns whether any selectable cell in this item is selected.

public bool IsAnyColumnSelected()

Returns

bool

IsButtonDisabled(int, int)

public bool IsButtonDisabled(int column, int index)

Parameters

column int
index int

Returns

bool

IsCellSelected(int)

Returns whether a selectable cell is selected, corresponding to Godot's per-cell is_selected().

public bool IsCellSelected(int column)

Parameters

column int

Returns

bool

Remarks

The name distinguishes it from the retained layer's existing item-level IsSelected convenience property.

IsChecked(int)

public bool IsChecked(int column)

Parameters

column int

Returns

bool

IsCustomBackgroundOutline(int)

public bool IsCustomBackgroundOutline(int column)

Parameters

column int

Returns

bool

IsCustomSetAsButton(int)

public bool IsCustomSetAsButton(int column)

Parameters

column int

Returns

bool

IsEditMultiline(int)

public bool IsEditMultiline(int column)

Parameters

column int

Returns

bool

IsEditable(int)

public bool IsEditable(int column)

Parameters

column int

Returns

bool

IsFoldingDisabled()

public bool IsFoldingDisabled()

Returns

bool

IsIndeterminate(int)

public bool IsIndeterminate(int column)

Parameters

column int

Returns

bool

IsRangeExponential(int)

public bool IsRangeExponential(int column)

Parameters

column int

Returns

bool

IsSelectable(int)

public bool IsSelectable(int column)

Parameters

column int

Returns

bool

IsVisibleInTree()

Returns whether this item and every ancestor are visible in the tree.

public bool IsVisibleInTree()

Returns

bool

MoveAfter(TreeItem)

Moves this item after item, matching Godot's move_after().

public void MoveAfter(TreeItem item)

Parameters

item TreeItem

MoveBefore(TreeItem)

Moves this item before item, matching Godot's move_before().

public void MoveBefore(TreeItem item)

Parameters

item TreeItem

PropagateCheck(int, bool)

Propagates this check state through descendants and updates ancestors, matching Godot's propagate_check().

public void PropagateCheck(int column, bool emitSignal = true)

Parameters

column int
emitSignal bool

Remove()

public void Remove()

Select(int, bool)

Selects this cell. In multi-select mode this preserves other selections, matching Godot's TreeItem.select().

public void Select(int column = 0, bool setAsCursor = true)

Parameters

column int
setAsCursor bool

SetAcceptChildren(bool)

Controls whether this item can be a child drop target, matching Godot's set_accept_children().

public void SetAcceptChildren(bool allowed)

Parameters

allowed bool

SetAsCursor(int)

Makes this cell the navigation cursor in multi-select mode without changing its selection state.

public void SetAsCursor(int column = 0)

Parameters

column int

SetButton(int, int, Texture2D)

public void SetButton(int column, int index, Texture2D button)

Parameters

column int
index int
button Texture2D

SetButtonColor(int, int, Color)

public void SetButtonColor(int column, int index, Color color)

Parameters

column int
index int
color Color

SetButtonDescription(int, int, string)

public void SetButtonDescription(int column, int index, string description)

Parameters

column int
index int
description string

SetButtonDisabled(int, int, bool)

public void SetButtonDisabled(int column, int index, bool disabled)

Parameters

column int
index int
disabled bool

SetButtonTooltipText(int, int, string)

public void SetButtonTooltipText(int column, int index, string tooltip)

Parameters

column int
index int
tooltip string

SetCellMode(int, TreeCellMode)

public void SetCellMode(int column, TreeCellMode mode)

Parameters

column int
mode TreeCellMode

SetChecked(int, bool)

public void SetChecked(int column, bool value)

Parameters

column int
value bool

SetCollapsed(bool)

public void SetCollapsed(bool collapsed)

Parameters

collapsed bool

SetCollapsedRecursive(bool)

Applies collapse state to this item and all descendants, matching Godot's set_collapsed_recursive().

public void SetCollapsedRecursive(bool collapsed)

Parameters

collapsed bool

SetCustomAsButton(int, bool)

Gives an editable custom cell button presentation, corresponding to Godot's set_custom_as_button().

public void SetCustomAsButton(int column, bool enable)

Parameters

column int
enable bool

SetCustomBackgroundColor(int, Color, bool)

Sets a Godot-style per-cell background override. When outlineOnly is true only a border is drawn.

public void SetCustomBackgroundColor(int column, Color color, bool outlineOnly = false)

Parameters

column int
color Color
outlineOnly bool

SetCustomColor(int, Color)

Sets a Godot-style per-cell text color override.

public void SetCustomColor(int column, Color color)

Parameters

column int
color Color

SetCustomDrawCallback(int, TreeItemCustomDrawCallback)

Sets the drawing callback for a custom cell, corresponding to Godot's set_custom_draw_callback().

public void SetCustomDrawCallback(int column, TreeItemCustomDrawCallback callback)

Parameters

column int
callback TreeItemCustomDrawCallback

SetCustomFont(int, SpriteFont)

Sets a per-cell SpriteFont override, corresponding to Godot's set_custom_font(). Pass null to inherit Font.

public void SetCustomFont(int column, SpriteFont font)

Parameters

column int
font SpriteFont

SetCustomFontSize(int, int)

Sets a per-cell font size override in pixels, corresponding to Godot's set_custom_font_size(). Use -1 to inherit the SpriteFont's native size.

public void SetCustomFontSize(int column, int fontSize)

Parameters

column int
fontSize int

SetCustomMinimumHeight(int)

Sets this row's minimum height, matching Godot's set_custom_minimum_height().

public void SetCustomMinimumHeight(int height)

Parameters

height int

SetCustomStyleBox(int, StyleBox)

Sets a per-cell visual surface, corresponding to Godot's set_custom_stylebox(). Pass null to clear it.

public void SetCustomStyleBox(int column, StyleBox styleBox)

Parameters

column int
styleBox StyleBox

SetCustomUIFont(int, UIFont)

Sets a per-cell logical font override while retaining the legacy SpriteFont value.

public void SetCustomUIFont(int column, UIFont font)

Parameters

column int
font UIFont

SetDescription(int, string)

Sets the accessibility description for a cell, matching Godot's set_description().

public void SetDescription(int column, string description)

Parameters

column int
description string

SetDisableFolding(bool)

Hides and disables this item's folding affordance, matching Godot's set_disable_folding().

public void SetDisableFolding(bool disabled)

Parameters

disabled bool

SetEditMultiline(int, bool)

Sets whether a string cell should use a multiline editor, matching Godot's set_edit_multiline().

public void SetEditMultiline(int column, bool multiline)

Parameters

column int
multiline bool

SetEditable(int, bool)

public void SetEditable(int column, bool editable)

Parameters

column int
editable bool

SetExpandRight(int, bool)

public void SetExpandRight(int column, bool enable)

Parameters

column int
enable bool

SetIcon(int, Texture2D)

Sets the primary texture for a Tree cell, corresponding to Godot's set_icon().

public void SetIcon(int column, Texture2D icon)

Parameters

column int
icon Texture2D

SetIconMaxWidth(int, int)

public void SetIconMaxWidth(int column, int maximumWidth)

Parameters

column int
maximumWidth int

SetIconModulate(int, Color)

public void SetIconModulate(int column, Color color)

Parameters

column int
color Color

SetIconOverlay(int, Texture2D)

public void SetIconOverlay(int column, Texture2D icon)

Parameters

column int
icon Texture2D

SetIconRegion(int, Rectangle?)

public void SetIconRegion(int column, Rectangle? region)

Parameters

column int
region Rectangle?

SetIndeterminate(int, bool)

public void SetIndeterminate(int column, bool value)

Parameters

column int
value bool

SetLanguage(int, string)

Sets the BCP-47 shaping language for a cell, matching Godot's set_language().

public void SetLanguage(int column, string language)

Parameters

column int
language string

SetMetadata(int, object)

Sets metadata for a cell, matching Godot's set_metadata().

public void SetMetadata(int column, object metadata)

Parameters

column int
metadata object

SetRange(int, float)

public void SetRange(int column, float value)

Parameters

column int
value float

SetRange(int, float, float, float)

Convenience overload that configures and assigns a range cell in one call.

public void SetRange(int column, float minimum, float maximum, float value)

Parameters

column int
minimum float
maximum float
value float

SetRangeConfig(int, float, float, float, bool)

public void SetRangeConfig(int column, float minimum, float maximum, float step = 1, bool exponential = false)

Parameters

column int
minimum float
maximum float
step float
exponential bool

SetSelectable(int, bool)

public void SetSelectable(int column, bool selectable)

Parameters

column int
selectable bool

SetSuffix(int, string)

Sets text displayed after a cell value, matching Godot's set_suffix().

public void SetSuffix(int column, string suffix)

Parameters

column int
suffix string

SetText(int, string)

public void SetText(int column, string text)

Parameters

column int
text string

SetTextAlignment(int, HorizontalAlignment)

public void SetTextAlignment(int column, HorizontalAlignment alignment)

Parameters

column int
alignment HorizontalAlignment

SetTextDirection(int, TextDirection)

Sets the cell text direction used by a shaping renderer, matching Godot's set_text_direction().

public void SetTextDirection(int column, TextDirection direction)

Parameters

column int
direction TextDirection

SetTooltipText(int, string)

public void SetTooltipText(int column, string tooltip)

Parameters

column int
tooltip string

SetVisible(bool)

public void SetVisible(bool visible)

Parameters

visible bool

UncollapseTree()

Expands this item and its ancestor chain, equivalent to Godot's uncollapse_tree().

public void UncollapseTree()