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
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
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
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
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
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
Adds a new empty module container to the ModuleContainer list passed as a parameter.
Input
Methods
ScrollUp ()
ScrollDown ()
ScrollLeft ()
ScrollRight ()
Version History
v4.0.3 (June 2, 2023)
Renamed "onSelect" to "selected" for code consistency with rest of the asset.
onSelectModuleContainers
toselectedModuleContainers
applyOnSelectModuleContainers
toapplySelectModuleContainers
ignoreChildOnSelectModuleContainers
toignoreChildSelectedModuleContainers
Renamed "onPress" to "beingPressed" for clarity about the fact that this is called constantly while the UI element is being pressed.
onPressModuleContainers
tobeingPressedModuleContainers
applyOnPressModuleContainers
toapplyBeingPressedModuleContainers
ignoreChildOnPressModuleContainers
toignoreChildBeingPressedModuleContainers
Renamed "onClick" to "pressComplete" for clarity about what it does.
onClickModuleContainers
topressCompleteModuleContainers
applyOnClickModuleContainers
toapplyPressCompleteModuleContainers
ignoreChildOnClickModuleContainers
toignoreChildPressCompleteModuleContainers
Renamed "unSelect" to "unSelected" for consistency with rest of the asset.
unSelectModuleContainers
tounSelectedModuleContainers
applyUnSelectModuleContainers
toapplyUnSelectedModuleContainers
ignoreChildUnSelectModuleContainers
toignoreChildUnSelectedModuleContainers
Last updated