User Tools

Site Tools


image_element

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
image_element [2020/12/02 20:20] justinimage_element [2020/12/02 20:59] justin
Line 8: Line 8:
 |{{:wiki:tag_id.png?nolink|}}|Element ID|ID for the image. This ID must be unique amongst other elements within the same [[widget]]. It is currently auto-generated but will be editable in a future update.| |{{:wiki:tag_id.png?nolink|}}|Element ID|ID for the image. This ID must be unique amongst other elements within the same [[widget]]. It is currently auto-generated but will be editable in a future update.|
 |{{:wiki:image.png?nolink|}}|Image|[[Image]] that will be displayed.| |{{:wiki:image.png?nolink|}}|Image|[[Image]] that will be displayed.|
 +|{{:wiki:arrow_in_out.png?nolink|}}|Stretch Mode|Determines how the source [[image]] will be rendered within the element. See [[Image Stretch Modes]] for an explanation of each option.|
 +|{{:wiki:margin_left.png?nolink|}}|Left Margin| |
 +|{{:wiki:margin_right.png?nolink|}}|Right Margin| |
 +|{{:wiki:margin_top.png?nolink|}}|Top Margin| |
 +|{{:wiki:margin_bottom.png?nolink|}}|Bottom Margin| |
  
 =====Scripting===== =====Scripting=====
-You can access and change certain properties of an image from within a [[script]] by simply referencing the parent [[widget]] and the element by their unique IDs. See below for examples of changing an image. In these cases, the [[widget]] has an ID of "test" and the button has an ID of "0001".+You can access and change certain properties of an image from within a [[script]] by simply referencing the parent [[widget]] and the element by their unique IDs. See below for an example of changing the element'image. In this case, the [[widget]] has an ID of "test" and the image has an ID of "0001".
  
-**Changing a button's text:** +**Changing an element's image:**
-<code bauxite> +
-widget["test"].element["0001"].text = "New Text" +
-</code> +
- +
-**Changing a button's image:**+
 <code bauxite> <code bauxite>
 widget["test"].element["0001"].image = "new_image.png" widget["test"].element["0001"].image = "new_image.png"
-</code> 
- 
-**Changing a button's script:** 
-<code bauxite> 
-widget["test"].element["0001"].script = "new_script_name" 
 </code> </code>
  
 ~~NOTOC~~ ~~NOTOC~~
image_element.txt · Last modified: 2024/02/21 21:14 by justin