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 revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
button [2020/11/30 22:47] justinbutton [2020/12/01 10:01] justin
Line 18: Line 18:
  
 =====Scripting===== =====Scripting=====
-You can access and change certain properties of a button from within a [[script]] by simply referencing the parent [[widget]] by ID followed by a reference to the button element by ID.+You can access and change certain properties of a button from within a [[script]] by simply referencing the parent [[widget]] by its ID followed by a reference to the button element by its ID.
  
 Changing a button's text: Changing a button's text:
 <code bauxite> <code bauxite>
-widget["test"].element["0001"].text = "New Text"+widget["test_id"].element["0001"].text = "New Text"
 </code> </code>
  
 Changing a button's image: Changing a button's image:
 <code bauxite> <code bauxite>
-widget["test"].element["0001"].image = "new_image.png"+widget["test_id"].element["0001"].image = "new_image.png"
 </code> </code>
  
 Changing a button's script: Changing a button's script:
 <code bauxite> <code bauxite>
-widget["test"].element["0001"].script = "new_script_name"+widget["test_id"].element["0001"].script = "new_script_name"
 </code> </code>
  
 ~~NOTOC~~ ~~NOTOC~~
button.txt · Last modified: 2021/06/24 21:18 by justin