PowerQuest 0.20.6
Loading...
Searching...
No Matches
IGuiControl Interface Reference

Detailed Description

All gui controls inherit from IGuiControl. (Buttons, Labels, etc)

    Label.ErrorMessage.Show();
    Image.Crosshair.Position = E.MousePosition();
    Button.Accept.Hide();

Also see specific gui controls: IButton, IImage, ILabel, IInventoryPanel, ISlider, ITextField

Inherited by IButton, IContainer, IImage, IInventoryPanel, ILabel, ISlider, and ITextField.

Properties

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)
 
string Description [get, set]
 Note: Not all gui controls implement these. But most do, so adding them here for convenience.
 
string Cursor [get, set]
 Gets or sets the cursor to show when hovering over the control (if it's clickable). If empty, default active cursor will be used.
 
string Text [get, set]
 Gets/Sets the text of the control (if it has any)
 
string Anim [get, set]
 Gets/Sets the Sprite (or animation) for the control. (if applicable). Note, that by default gui Image controls may not have a "Power Sprite Animation" component, and this needs to be added for them to play animations.
 
Color Color [get, set]
 Gets/Sets the color for the control (if applicable)
 

Public Member Functions

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)
 

Property Documentation

◆ Instance

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.

◆ Visible

bool Visible
getset

Sets the control visible invisible the control.

◆ Position

Vector2 Position
getset

Gets/Sets the position of the control. Note that this will be overridden if using AlignTo or FitTo component.

◆ Focused

bool Focused
get

Gets/Sets whether this control is focused (ie: the mouse is hovering over it, or it's selected with keyboard)

◆ HasKeyboardFocus

bool HasKeyboardFocus
getset

Gets/Sets whether this control has the current keyboard focus (can also be used for specifying which control has 'controller' focus)

◆ Description

string Description
getset

Note: Not all gui controls implement these. But most do, so adding them here for convenience.

Gets/Sets the description text shown to players when they hover the mouse over the control (if it's clickable).

Implemented in IButton, ISlider, and ITextField.

◆ Cursor

string Cursor
getset

Gets or sets the cursor to show when hovering over the control (if it's clickable). If empty, default active cursor will be used.

Implemented in IButton, ISlider, and ITextField.

◆ Text

string Text
getset

Gets/Sets the text of the control (if it has any)

Implemented in IButton, ILabel, ISlider, and ITextField.

◆ Anim

string Anim
getset

Gets/Sets the Sprite (or animation) for the control. (if applicable). Note, that by default gui Image controls may not have a "Power Sprite Animation" component, and this needs to be added for them to play animations.

Implemented in IButton, and IImage.

◆ Color

Color Color
getset

Gets/Sets the color for the control (if applicable)

Implemented in IButton, ILabel, and ISlider.

Member Function Documentation

◆ Show()

void Show ( )

Shows the control.

◆ Hide()

void Hide ( )

Hides the control.

◆ SetPosition()

void SetPosition ( float x,
float y )

Sets the position of the control. Note that this will be overridden if using AlignTo or FitTo component.

◆ DuplicateControl()

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)