-
Notifications
You must be signed in to change notification settings - Fork 25
OGPopUp
Jeppe Zapp edited this page Feb 6, 2014
·
4 revisions
A popup widget
| Variable | Type | |
|---|---|---|
| title | string |
Text displayed if no option is selected |
| options | string[] |
Available options in string form |
| selectedOption | string |
The currently selected option |
| selectedIndex | int |
The currently selected option by index |
| target | GameObject |
Message handler |
| message | string |
Message for the message handler |
| passSelectedOption | boolean |
Whether or not to pass the selected option as an argument to the message handler |
| isUp | boolean |
Is the widget active? |
| Method | Return type | |
|---|---|---|
SetOptions ( list : String[] ) |
void |
Set the available options |
var pop : OGPopUp = new GameObject ( "PopUp", OGPopUp ).GetComponent.<OGPopUp>();
var listOfStrings : List.< String > = new List.< String > ();
listOfStrings.Add ( "One" );
listOfStrings.Add ( "Two" );
listOfStrings.Add ( "Three" );
pop.title = "Options";
pop.target = this.gameObject;
pop.message = "SelectOption";
pop.passSelectedOption = true;
pop.options = listOfStrings;
pop.transform.localPosition = new Vector3 ( 10, 10, 0 );
pop.transform.localScale = new Vector3 ( 300, 20, 1 );
btn.GetDefaultStyles ();