Each gui you create will have its own GuiScript file These are created automatically with the name appended, eg: GuiKeypad.cs
From Gui scripts you have some helpful properties give access to their own IGui, and Controls. View the full list is here.
Eg:
Label.KeypadReadout.Text = "ENTER PASSWORD";
Button.KeypadEnter.Color = Color.Red;
Data.Hide();
Inherits GuiScript.
|
IGui | Data () |
| Retrieve the gui for this script.
|
|
void | OnShow () |
| Called when the Gui is made visible.
|
|
void | Update () |
| Called every frame. Non-blocking functions only.
|
|
IEnumerator | OnAnyClick (IGuiControl control) |
| Blocking script called when ANY click is made on the gui.
|
|
IEnumerator | OnClick (IGuiControl control) |
| Blocking script called when a button is clicked. The name is appended to the function, eg: OnClickAcceptButton(...).
|
|
IGuiControl | Control (string name) |
| Gets an IGuiControl from this script's gui. All gui buttons, image, labels, etc are types of Controls. This function returns their base class. Can be used for your own custom Controls too. eg. Control.MyCustomButton.Hide() eg. Control.MyCustomControl.Instance.GetComponent<CoolCustomControl>().DoSomethingCool();
|
|
IButton | Button (string name) |
| Gets an IButton from this script's gui. eg. Button.KeypadEnter.Clickable = false;
|
|
ILabel | Label (string name) |
| Gets an ILabel from this script's gui. eg. Label.KeypadReadout.Text = "ENTER PASSWORD";
|
|
IImage | Image (string name) |
| Gets an IImage from this script's gui. eg. Image.LockedIndicator.Image = "Unlocked";
|
|
ISlider | Slider (string name) |
| Gets an ISlider from this script's gui. eg. Sliders.Volume.Ratio = Settings.Volume";
|
|
ITextField | TextField (string name) |
| Gets an ITextField from this script's gui. eg. TextFields.FullName.Text = "Enter thy name";
|
|
IInventoryPanel | InventoryPanel (string name) |
| Gets an IInventoryPanel from this script's gui. eg. IInventoryPanel.MyInvPanel.ScrollForward();
|
|
IContainer | Container (string name) |
| Gets an IContainer from this script's gui. eg. IContainer.MyList.Grid.ScrollForward();
|
|