Gui Button- Buttons are a bit like your room's props, but they have a few more states so they can animate when clicked.
Button.KeypadEnter.Clickable = false;
Button.AnimHover = "FlashRed";
Button.ColorPress = Color.yellow;
Button.Text = "Let's do it";
Button.Description = "This button wins the game";
|
| new string | Description [get, set] |
| | Gets/Sets the description text shown to players when they hover the mouse over the control.
|
| |
| new string | Cursor [get, set] |
| | Gets or sets the cursor to show when hovering over the control. If empty, default active cursor will be used.
|
| |
| new string | Text [get, set] |
| | Gets/Sets the text in the button (if it has any)
|
| |
| new string | Anim [get, set] |
| | Gets/Sets the default Sprite (or animation)
|
| |
| string | AnimHover [get, set] |
| | Gets/Sets the Sprite (or animation) shown when the button is selected/hovered.
|
| |
| string | AnimClick [get, set] |
| | Gets/Sets the Sprite (or animation) shown when the button is pressed.
|
| |
| string | AnimOff [get, set] |
| | Gets/Sets the Sprite (or animation) shown when the button is disabled (when Clickable = false)
|
| |
| new Color | Color [get, set] |
| | Gets/Sets the color for the control.
|
| |
| Color | ColorHover [get, set] |
| | Gets/Sets the color for the control when the button is selected/hovered over.
|
| |
| Color | ColorClick [get, set] |
| | Gets/Sets the color for the control when the buttons is clicked.
|
| |
| Color | ColorOff [get, set] |
| | Gets/Sets the color for the control when the button is disabled (when Clickable = false)
|
| |
| bool | Clickable [get, set] |
| | Gets or Sets whether clicking on the object triggers an event.
|
| |
| bool | Animating [get] |
| | Whether an animation triggered by PlayAnimation() is currently playing. Note- this does not include animations set using the Anim property.
|
| |
| float | Alpha [get, set] |
| | Gets/Sets the transparency of the sprite. (0.0f being fully transparent, 1.0f being fully opaque.)
|
| |
| MonoBehaviour | Instance [get] |
| | Access to the actual game object component in the scene. Note that controls themselves can be cast to their component type if known.
|
| |
| bool | Visible [get, set] |
| | Sets the control visible invisible the control.
|
| |
| Vector2 | Position [get, set] |
| | Gets/Sets the position of the control. Note that this will be overridden if using AlignTo or FitTo component.
|
| |
| bool | Focused [get] |
| | Gets/Sets whether this control is focused (ie: the mouse is hovering over it, or it's selected with keyboard)
|
| |
| bool | HasKeyboardFocus [get, set] |
| | Gets/Sets whether this control has the current keyboard focus (can also be used for specifying which control has 'controller' focus)
|
| |
|
| void | PauseAnimation () |
| | Pauses the currently playing animation. Only works for animations played with PlayAnimationBG()
|
| |
| void | ResumeAnimation () |
| | Resumes playing the current animation after PauseAnimation() was called.
|
| |
| void | StopAnimation () |
| | Stops the current animation- returns to Idle animation. Only works for animations played with PlayAnimationBG()
|
| |
| Coroutine | PlayAnimation (string animName) |
| | Plays an animation on the control. Will block the script until complete.
|
| |
| void | PlayAnimationBG (string animName) |
| | Play an animation on the control without halting the script. Will return to idle after animation ends, unless pauseAtEnd is true.
|
| |
| void | AddAnimationTrigger (string triggerName, bool removeAfterTriggering, System.Action action) |
| | Adds a function to be called on an animation event here. Eg: to play a sound or effect on an animation tag.
|
| |
| void | RemoveAnimationTrigger (string triggerName) |
| | Removes an existing animation trigger.
|
| |
| Coroutine | WaitForAnimTrigger (string triggerName) |
| | Waits until an Event/Tag in the current animation is reached.
|
| |
| Coroutine | Fade (float start, float end, float duration, eEaseCurve curve=eEaseCurve.Smooth) |
| | Fade the sprite's alpha. (0.0f being fully transparent, 1.0f being fully opaque.)
|
| |
| void | FadeBG (float start, float end, float duration, eEaseCurve curve=eEaseCurve.InOutSmooth) |
| | Fade the sprite's alpha (non-blocking). (0.0f being fully transparent, 1.0f being fully opaque.)
|
| |
| void | Show () |
| | Shows the control.
|
| |
| void | Hide () |
| | Hides the control.
|
| |
| void | SetPosition (float x, float y) |
| | Sets the position of the control. Note that this will be overridden if using AlignTo or FitTo component.
|
| |
| GuiControl | DuplicateControl (string name=null, IGuiControl parent=null) |
| | Duplicates the control. Useful for adding elements dynamically to a gui. You can optionally specify a new name for the control, and a parent object (such as a grid container)
|
| |