Script documentation

List.cs in TinyGiantStudio.Text namespace

If anything except method names starts with a capital letter, it's a property. Read the UI States section to understand what the terms like "press complete" mean in the asset.

Utility

Variables

Variable
Type
Description

selectedItem

int

autoFocusOnStart

bool

If set to true, the list is focused on awake. The list is scrollable with a keyboard when focused.

autoFocusFirstItem

bool

Selects first item in the list when focused.

Methods

Method
Description

UpdateList ()

Updates the positioning of items in the list if it has a layout group.

Focus ()

Toggles the focus on the list. When a list is focused, it can be scrolled with a keyboard/controller, if that is enabled.

Focus (bool enable)

Enables/disables focus depending on the bool passed as a parameter. When a list is focused, it can be scrolled with a keyboard/controller, if that is enabled.

Focus (bool enable, bool delay)

If the second parameter delay is set to true, the list is focused after a single frame. Enables/disables focus depending on the bool passed as the first parameter. When a list is focused, it can be scrolled with a keyboard/controller, if that is enabled.

SelectItem (int number)

Processes the selected item for the list. Doesn't let the selected item know it was selected. Call the AlertSelectedItem(int number) to update the UI item.

AlertSelectedItem (int number)

Alerts the list item that was selected. Doesn't alert the list. Call the SelectItem (int number) to update the UI item.

UnselectItem(int number)

Unselects the child in the list whose index was passed as parameter.

UnselectEverything ()

Unselects everything.

UnselectEverythingExceptSelected ()

Unselects everything except the selected item. This is useful for handling UI with random states being added to the list.

UnselectEverythingDontChangeSelectedItemValue ()

Unselects everything but does not reset the "selectedItem" number. Keeping the selected item value means the previously selected item can still be pressed after selected and scrolling via keyboard continues from the previously selected one instead of starting from 0

PressSelectedItem ()

PresstItem (int number)

Style

Styles control child element visuals.

Variables

Variable
Type
Description

UseStyle

bool

If set to false, disables all style controls from this list.

UseNormalItemVisual

bool

If set to false, disables normal style from being applied from this list. An individual element's own style is used in that case.

NormalTextSize

Vector3

NormalTextMaterial

Material

NormalBackgroundMaterial

Material

UseSelectedItemVisual

bool

If set to false, disables the 'selected' style from being applied from the list. An individual element's own style is used in that case.

SelectedTextSize

Vector3

SelectedTextMaterial

Material

SelectedBackgroundMaterial

Material

UsePressedItemVisual

bool

If set to false, disables the 'pressed' style from being applied from the list. An individual element's own style is used in that case.

PressedTextSize

Vector3

PressedTextMaterial

Material

PressedBackgroundMaterial

Material

holdPressedVisualFor

float

UseDisabledItemVisual

bool

If set to false, disables the 'pressed' style from being applied from the list. An individual element's own style is used in that case.

DisabledTextSize

Vector3

DisabledTextMaterial

Material

DisabledBackgroundMaterial

Material

Methods

Variable
Description

UpdateStyle ()

Updates the style options of all child UI elements.

Note: The term "unselect" here is used instead of "normal" like style states because these modules are not called when the list items enter the normal first time, but instead, enter a "normal" state after being "selected".

Variables

Variable
Type
Description

useModules

bool

If set to false, disables all modules on this list.

ignoreChildModules

bool

If set to false, disables all modules on the list items like buttons.

unSelectedModuleContainers

applyUnSelectedModuleContainers

bool

ignoreChildUnSelectedModuleContainers

bool

If set to true, if any child element like buttons have Un-Select Modules, they are ignored.

selectedModuleContainers

applySelectedModuleContainers

bool

ignoreChildSelectedModuleContainers

bool

If set to true, if any child element like buttons have selected Modules, they are ignored.

beingPressedModuleContainers

ignoreChildUnSelectedModuleContainers

bool

ignoreChildBeingPressedModuleContainers

bool

pressCompleteModuleContainers

applyPressCompleteModuleContainers

bool

ignoreChildPressCompleteModuleContainers

bool

Methods

Variable
Description

Adds a new empty module container to the ModuleContainer list passed as a parameter.

Input

Methods

Variable
Description

ScrollUp ()

ScrollDown ()

ScrollLeft ()

ScrollRight ()

Version History

v4.0.3 (June 2, 2023)

Renamed "onSelect" to "selected" for code consistency with rest of the asset.

  1. onSelectModuleContainers to selectedModuleContainers

  2. applyOnSelectModuleContainers to applySelectModuleContainers

  3. ignoreChildOnSelectModuleContainers to ignoreChildSelectedModuleContainers

Renamed "onPress" to "beingPressed" for clarity about the fact that this is called constantly while the UI element is being pressed.

  1. onPressModuleContainers to beingPressedModuleContainers

  2. applyOnPressModuleContainers to applyBeingPressedModuleContainers

  3. ignoreChildOnPressModuleContainers to ignoreChildBeingPressedModuleContainers

Renamed "onClick" to "pressComplete" for clarity about what it does.

  1. onClickModuleContainers to pressCompleteModuleContainers

  2. applyOnClickModuleContainers to applyPressCompleteModuleContainers

  3. ignoreChildOnClickModuleContainers to ignoreChildPressCompleteModuleContainers

Renamed "unSelect" to "unSelected" for consistency with rest of the asset.

  1. unSelectModuleContainers to unSelectedModuleContainers

  2. applyUnSelectModuleContainers to applyUnSelectedModuleContainers

  3. ignoreChildUnSelectModuleContainers to ignoreChildUnSelectedModuleContainers

Last updated