User Tools

Site Tools


button

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
button [2021/06/24 21:17]
justin
button [2021/06/24 21:18]
justin
Line 9: Line 9:
 |{{:wiki:button.png?nolink|}}|Button Type|Determines whether the button will have standard behavior or if it will behave as a toggle button (i.e. the button toggles between an "on" and "off" state each time it's pressed).| |{{:wiki:button.png?nolink|}}|Button Type|Determines whether the button will have standard behavior or if it will behave as a toggle button (i.e. the button toggles between an "on" and "off" state each time it's pressed).|
 |{{:wiki:play.png?nolink|}}|Button Action|Determines what action will be taken when the button is pressed (only applicable to the "Standard" button type). The available options are to run a [[script]], close the parent [[widget]], craft a new [[item]] into a [[item_storage_slot|storage slot]] using any populated [[crafting_input_slot|input slots]], or craft a specific [[item]] using the player's [[inventory]].| |{{:wiki:play.png?nolink|}}|Button Action|Determines what action will be taken when the button is pressed (only applicable to the "Standard" button type). The available options are to run a [[script]], close the parent [[widget]], craft a new [[item]] into a [[item_storage_slot|storage slot]] using any populated [[crafting_input_slot|input slots]], or craft a specific [[item]] using the player's [[inventory]].|
-|{{:wiki:script.png?nolink|}}|Script|[[Script]] that will be triggered when the button is clicked. This option is only available when the button type is "Toggle" or the button type is "Standard" with an action of "Run Script". In both cases, a local variable named **$widget** will be available to your [[script]] that references the [[widget]] in which the button is contained. The **self** keyword will reference the button element itself. For toggle buttons, a local variable named **$pressed** will also be available. It will have a value of either true or false according to the new state of the button.|+|{{:wiki:script.png?nolink|}}|Script|[[Script]] that will be triggered when the button is clicked. This option is only available when the button type is "Toggle" or the button type is "Standard" with an action of "Run Script". In both cases, a local variable named **$widget** will be available to your [[script]] that references the [[widget]] in which the button is contained. The **self** keyword will reference the button element itself. For toggle buttons, a local variable named **$pressed** will also be available. It will have a value of either true or false according to the new state of the button (i.e. pressed or not pressed).|
 |{{:wiki:item.png?nolink|}}|Item|[[Item]] that the game will attempt to craft using the player's [[inventory]] when the button is clicked. This option is only available when the button type is "Standard" with an action of "Craft Item by ID".| |{{:wiki:item.png?nolink|}}|Item|[[Item]] that the game will attempt to craft using the player's [[inventory]] when the button is clicked. This option is only available when the button type is "Standard" with an action of "Craft Item by ID".|
 |{{:wiki:image.png?nolink|}}|Image|[[Image]] that will be displayed on the button. If an [[image]] is specified, it will appear to the left of the button's text.| |{{:wiki:image.png?nolink|}}|Image|[[Image]] that will be displayed on the button. If an [[image]] is specified, it will appear to the left of the button's text.|
button.txt ยท Last modified: 2021/06/24 21:18 by justin