PowerQuest 0.17.3
IGui Interface Reference

Detailed Description

IGui: Contains functions for and data manipluating Gui objects.

    G.Inventory.Show();
    G.HoverText.Hide();
    G.Prompt.Script.Show("Are you sure you want to quit?","Yes","No", ()=>Application.Quit());

Properties

string ScriptName [get]
 The name used in scripts. More...
 
MonoBehaviour Instance [get]
 Access to the actual game object component in the scene. More...
 
bool Visible [get, set]
 Gets or sets whether the object is visible. More...
 
bool Clickable [get, set]
 Gets or Sets whether clicking on the object triggers an event. Can be set false to have a gui visible but not clickable. More...
 
bool HasFocus [get]
 
bool Modal [get, set]
 Gets or Sets whether this gui blocks clicks behind it. More...
 
bool PauseGame [get, set]
 Whether gameplay is paused while the gui is visible. More...
 
Vector2 Position [get, set]
 The location of the gui. Note that if gui is aligned to screen, changing this won't have an effect. More...
 
float Baseline [get, set]
 Gets or sets the baseline used for sorting. Just like with hotspots/charcters, LOWER is in-front (eg: -4 is in-front of 6) More...
 
string Cursor [get, set]
 Sets a cursor to show when hovering over the gui's hotspot (or anywhere if its a modal gui). Can be overriden by specific controls. More...
 
Gui Data [get]
 PowerQuest internal function: Access to the base class with extra functionality. More...
 

Public Member Functions

void Show ()
 Sets a gui visible and clickable. More...
 
void Hide ()
 
void ShowAtFront ()
 Shows the gui, in front of all others. More...
 
void ShowAtBack ()
 Shows the gui, behind all others. More...
 
void ShowBehind (IGui gui)
 Shows the gui, behind a specific other gui. More...
 
void ShowInfront (IGui gui)
 Shows the gui, in front of a specific other gui. More...
 
bool Navigate (eGuiNav button)
 Tells the gui to handle a keyboard or controller input. eg. Left/Right/Up/Down inputs will navigate between controls, or slide sliders, and 'Ok' will press buttons. Call this from your gui script or global script if the gui is focused. Returns true if button did something. More...
 
void NavigateToControl (IGuiControl control)
 
void ResetNavigation ()
 
GuiControl GetControl (string name)
 
bool HasControl (string name)
 Returns true if the control exists. More...
 
GetScript< T > ()
 PowerQuest internal function: Access to the specific quest script for the room. Use the specific room script as the templated parameter so you can access specific members of the script. Eg: GetScript<GuiPrompt>().Show("Blah");
More...
 

Property Documentation

◆ ScriptName

string ScriptName
get

The name used in scripts.

◆ Instance

MonoBehaviour Instance
get

Access to the actual game object component in the scene.

◆ Visible

bool Visible
getset

Gets or sets whether the object is visible.

◆ Clickable

bool Clickable
getset

Gets or Sets whether clicking on the object triggers an event. Can be set false to have a gui visible but not clickable.

◆ Modal

bool Modal
getset

Gets or Sets whether this gui blocks clicks behind it.

◆ PauseGame

bool PauseGame
getset

Whether gameplay is paused while the gui is visible.

◆ Position

Vector2 Position
getset

The location of the gui. Note that if gui is aligned to screen, changing this won't have an effect.

◆ Baseline

float Baseline
getset

Gets or sets the baseline used for sorting. Just like with hotspots/charcters, LOWER is in-front (eg: -4 is in-front of 6)

◆ Cursor

string Cursor
getset

Sets a cursor to show when hovering over the gui's hotspot (or anywhere if its a modal gui). Can be overriden by specific controls.

◆ Data

Gui Data
get

PowerQuest internal function: Access to the base class with extra functionality.

Member Function Documentation

◆ Show()

void Show ( )

Sets a gui visible and clickable.

◆ ShowAtFront()

void ShowAtFront ( )

Shows the gui, in front of all others.

◆ ShowAtBack()

void ShowAtBack ( )

Shows the gui, behind all others.

◆ ShowBehind()

void ShowBehind ( IGui  gui)

Shows the gui, behind a specific other gui.

◆ ShowInfront()

void ShowInfront ( IGui  gui)

Shows the gui, in front of a specific other gui.

◆ Navigate()

bool Navigate ( eGuiNav  button)

Tells the gui to handle a keyboard or controller input. eg. Left/Right/Up/Down inputs will navigate between controls, or slide sliders, and 'Ok' will press buttons. Call this from your gui script or global script if the gui is focused. Returns true if button did something.

◆ GetControl()

GuiControl GetControl ( string  name)

Retreives a specific IGuiControl from the gui.

Controls can be cast to Buttons, Labels, etc. Eg:

IButton button = (IButton)G.Keypad.GetControl("AcceptButton");
button.Color = Color.Red;

NB: The gui must be instantiated for this to work. It might not work in scene loading scripts.

◆ HasControl()

bool HasControl ( string  name)

Returns true if the control exists.

◆ GetScript< T >()

T GetScript< T > ( )

PowerQuest internal function: Access to the specific quest script for the room. Use the specific room script as the templated parameter so you can access specific members of the script. Eg: GetScript<GuiPrompt>().Show("Blah");

Type Constraints
T :GuiScript<T>