(Added and defined all members (15) of SUIDropdown) |
(Added simple examples to all members (15) of SUIDropdown) |
||
Line 1: | Line 1: | ||
=Members= | =Members= | ||
− | {{ScriptFunction|void|AddOptions|(Table options)|Add multiple options to the options of the Dropdown.|5=<pre></pre>}} | + | {{ScriptFunction|void|AddOptions|(Table options)|Add multiple options to the options of the Dropdown.|5=<pre>Space.Host.ExecutingObject.UIDropdown.AddOptions({"option1","option2","option3"})</pre>}} |
− | {{ScriptFunction|void|ClearOptions|()|Clear the list of options in the Dropdown.|5=<pre></pre>}} | + | {{ScriptFunction|void|ClearOptions|()|Clear the list of options in the Dropdown.|5=<pre>Space.Host.ExecutingObject.UIDropdown.ClearOptions()</pre>}} |
− | {{ScriptFunction|void|Hide|()|Hide the dropdown list.|5=<pre></pre>}} | + | {{ScriptFunction|void|Hide|()|Hide the dropdown list.|5=<pre>Space.Host.ExecutingObject.UIDropdown.Hide()</pre>}} |
− | {{ScriptFunction|void|OnValueChanged|(Closure callback)|Bind a function to handle the event that is invoked when when a user has clicked one of the options in the dropdown list.|5=<pre></pre>}} | + | {{ScriptFunction|void|OnValueChanged|(Closure callback)|Bind a function to handle the event that is invoked when when a user has clicked one of the options in the dropdown list.|5=<pre>https://wiki.sine.space/index.php?title=Scripting/SUIDropdown</pre>}} |
− | {{ScriptFunction|void|RefreshShownValue|()|Refreshes the text and image (if available) of the currently selected option.If you have modified the list of options, you should call this method afterwards to ensure that the visual state of the dropdown corresponds to the updated options.|5=<pre></pre>}} | + | {{ScriptFunction|void|RefreshShownValue|()|Refreshes the text and image (if available) of the currently selected option.If you have modified the list of options, you should call this method afterwards to ensure that the visual state of the dropdown corresponds to the updated options.|5=<pre>Space.Host.ExecutingObject.UIDropdown.RefreshShownValue()</pre>}} |
− | {{ScriptFunction|void|Show|()|Show the dropdown list.|5=<pre></pre>}} | + | {{ScriptFunction|void|Show|()|Show the dropdown list.|5=<pre>Space.Host.ExecutingObject.UIDropdown.Show()</pre>}} |
Line 16: | Line 16: | ||
=Properties= | =Properties= | ||
− | {{ScriptFunction|SUIImage|CaptionImage|{ get; set; }|The Image component to hold the image of the currently selected option.|5= <pre></pre>}} | + | {{ScriptFunction|SUIImage|CaptionImage|{ get; set; }|The Image component to hold the image of the currently selected option.|5= <pre>captionImage = Space.Host.ExecutingObject.UIDropdown.CaptionImage</pre>}} |
− | {{ScriptFunction|SUIText|CaptionText|{ get; set; }|The Text component to hold the text of the currently selected option.|5= <pre></pre>}} | + | {{ScriptFunction|SUIText|CaptionText|{ get; set; }|The Text component to hold the text of the currently selected option.|5= <pre>captionText = Space.Host.ExecutingObject.UIDropdown.CaptionText |
+ | captionText.Text = "new caption"</pre>}} | ||
− | {{ScriptFunction|bool|Interactable|{ get; set; }| | + | {{ScriptFunction|bool|Interactable|{ get; set; }|Is this UIDropdown interactable?|5= <pre>Space.Host.ExecutingObject.UIDropdown.Interactable = true</pre>}} |
− | {{ScriptFunction|SUIImage|ItemImage|{ get; set; }|The Image component to hold the image of the item.|5= <pre></pre>}} | + | {{ScriptFunction|SUIImage|ItemImage|{ get; set; }|The Image component to hold the image of the item.|5= <pre>itemImage = Space.Host.ExecutingObject.UIDropdown.ItemImage</pre>}} |
− | {{ScriptFunction|SUIText|ItemText|{ get; set; }|The Text component to hold the text of the item.|5= <pre></pre>}} | + | {{ScriptFunction|SUIText|ItemText|{ get; set; }|The Text component to hold the text of the item.|5= <pre>Space.Host.ExecutingObject.UIDropdown.ItemText.Text = "new text"</pre>}} |
− | {{ScriptFunction|SGameObject|Template|{ get; set; }|The Rect Transform of the template for the dropdown list.|5= <pre></pre>}} | + | {{ScriptFunction|SGameObject|Template|{ get; set; }|The Rect Transform of the template for the dropdown list.|5= <pre>ddRect = Space.Host.ExecutingObject.UIDropdown.Template</pre>}} |
− | {{ScriptFunction|int|Value|{ get; set; }|The Value is the index number of the current selection in the Dropdown. 0 is the first option in the Dropdown, 1 is the second, and so on.|5= <pre></pre>}} | + | {{ScriptFunction|int|Value|{ get; set; }|The Value is the index number of the current selection in the Dropdown. 0 is the first option in the Dropdown, 1 is the second, and so on.|5= <pre>Space.Host.ExecutingObject.UIDropdown.Value= 2</pre>}} |
− | {{ScriptFunction|SResource[]|OptionsAsSprites|{ get; }|The list of possible options. (Sprites)|5= <pre></pre>}} | + | {{ScriptFunction|SResource[]|OptionsAsSprites|{ get; }|The list of possible options. (Sprites)|5= <pre>optionsSprites = Space.Host.ExecutingObject.UIDropdown.OptionsAsSprites</pre>}} |
− | {{ScriptFunction|string[]|OptionsAsText|{ get; }|The list of possible options. (Text)|5= <pre></pre>}} | + | {{ScriptFunction|string[]|OptionsAsText|{ get; }|The list of possible options. (Text)|5= <pre>optionsText = Space.Host.ExecutingObject.UIDropdown.OptionsAsText</pre>}} |
{{Scripting Navbox}} | {{Scripting Navbox}} |
Add multiple options to the options of the Dropdown.
Space.Host.ExecutingObject.UIDropdown.AddOptions({"option1","option2","option3"})
Clear the list of options in the Dropdown.
Space.Host.ExecutingObject.UIDropdown.ClearOptions()
Hide the dropdown list.
Space.Host.ExecutingObject.UIDropdown.Hide()
Bind a function to handle the event that is invoked when when a user has clicked one of the options in the dropdown list.
https://wiki.sine.space/index.php?title=Scripting/SUIDropdown
Refreshes the text and image (if available) of the currently selected option.If you have modified the list of options, you should call this method afterwards to ensure that the visual state of the dropdown corresponds to the updated options.
Space.Host.ExecutingObject.UIDropdown.RefreshShownValue()
Show the dropdown list.
Space.Host.ExecutingObject.UIDropdown.Show()
The Image component to hold the image of the currently selected option.
captionImage = Space.Host.ExecutingObject.UIDropdown.CaptionImage
The Text component to hold the text of the currently selected option.
captionText = Space.Host.ExecutingObject.UIDropdown.CaptionText captionText.Text = "new caption"
Is this UIDropdown interactable?
Space.Host.ExecutingObject.UIDropdown.Interactable = true
The Image component to hold the image of the item.
itemImage = Space.Host.ExecutingObject.UIDropdown.ItemImage
The Text component to hold the text of the item.
Space.Host.ExecutingObject.UIDropdown.ItemText.Text = "new text"
The Rect Transform of the template for the dropdown list.
ddRect = Space.Host.ExecutingObject.UIDropdown.Template
The Value is the index number of the current selection in the Dropdown. 0 is the first option in the Dropdown, 1 is the second, and so on.
Space.Host.ExecutingObject.UIDropdown.Value= 2
The list of possible options. (Sprites)
optionsSprites = Space.Host.ExecutingObject.UIDropdown.OptionsAsSprites
The list of possible options. (Text)
optionsText = Space.Host.ExecutingObject.UIDropdown.OptionsAsText
|