Script documentation
Button.cs in TinyGiantStudio.Text namespace
Last updated
Button.cs in TinyGiantStudio.Text namespace
Last updated
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.
Variable | Type | Description |
---|---|---|
Method | |
---|---|
Renamed "unSelect" to "unSelected" for consistency with the rest of the asset.
onUnselect
to unselectEvent
unSelectModuleContainers
to unSelectedModuleContainers
applyUnSelectModuleContainers
to applyUnSelectedModuleContainers
Renamed "onSelect" to "selected" for code consistency with the rest of the asset.
onSelect
to selectedEvent
onSelectModuleContainers
to selectedModuleContainers
applyOnSelectModuleContainers
to applySelectModuleContainers
Renamed "onPress" to "beingPressed" for clarity about the fact that this is called constantly while the UI element is being pressed.
whileBeingClicked
to beingPressedEvent
onPressModuleContainers
to beingPressedModuleContainers
applyOnPressModuleContainers
to applyBeingPressedModuleContainers
ButtonBeingPressedModuleUpdate to
Renamed "onClick" to "pressComplete" for clarity about what it does.
onClick
to pressCompleteEvent
onClickModuleContainers
to pressCompleteModuleContainers
applyOnClickModuleContainers
to applyPressCompleteModuleContainers
Method PressedButtonClickStopped()
to PressCompleted()
Method OnClickButtonModuleUpdate()
to PressCompleteButtonModuleUpdate ()
OnPressButtonModuleUpdate
to ButtonBeingPressedModuleUpdate
renamed to better clarify what it does.
Variable | Type | Description |
---|---|---|
Variable | Type | Description |
---|---|---|
Method | |
---|---|
Variable | Type | Description |
---|---|---|
Method | Description |
---|---|
Text
The text assigned to the button. The button can change material, text size depending on Style.
Background
Renderer
The background is assigned to the button. The button can change material depending on Style.
isSelected
bool
settings
Used to load default values when creating new button.
SelectButton ()
This calls for all the required methods for selecting it. Visual, Module, Event, and if required, list events.
UnselectButton ()
This calls for all the required methods for unselecting it. Visual, Module, Event.
PressButton ()
This calls for all the required methods for selecting it. Visual, Module, Event, and if required, list events. Used everywhere except list.
PressButtonDontCallList ()
Same as PressButton except, it doesn't call list. Used by list to avoid recursion.
ButtonBeingPressed ()
PressCompleted ()
Uninteractable ()
Call this to set the button as Uninteractable
Interactable ()
Call this to set the button as Interactable
unselectEvent
UnityEvent
This is the state that appears when a UI element enters the normal state from selected.
selectedEvent
UnityEvent
Mouse hover on the item or selected item via keyboard/controller in a list.
beingPressedEvent
UnityEvent
While the mouse/keyboard/controller button is pressed down or touch held down, the module or event is constantly called.
pressCompleteEvent
UnityEvent
When the user releases the key. In other words, the frame when the button/key or touch being pressed is complete.
useStyles
bool
NormalTextSize
Vector3
NormalTextMaterial
Material
NormalBackgroundMaterial
Material
useSelectedVisual
bool
SelectedTextSize
Vector3
SelectedTextMaterial
Material
SelectedBackgroundMaterial
Material
usePressedVisual
bool
PressedTextSize
Vector3
PressedTextMaterial
Material
PressedBackgroundMaterial
Material
holdPressedVisualFor
float
UseDisabledVisual
bool
DisabledTextSize
Vector3
DisabledTextMaterial
DisabledBackgroundMaterial
UpdateStyle ()
UnselectedButtonVisualUpdate ()
SelectedButtonVisualUpdate ()
PressButtonVisualUpdate ()
DisabledButtonVisualUpdate ()
useModules
bool
If set to false, disables all modules from this button. Modules are called when entering a style for the first time.
unSelectedModuleContainers
applyUnSelectedModuleContainers
bool
selectedModuleContainers
applySelectedModuleContainers
bool
beingPressedModuleContainers
applyBeingPressedModuleContainers
bool
pressCompleteModuleContainers
applyPressCompleteModuleContainers
bool
UnselectButtonModuleUpdate ()
SelectedButtonModuleUpdate ()
BeingPressedButtonModuleUpdate ()
PressCompleteButtonModuleUpdate ()
EmptyEffect (List <> moduleList, Module module = null)