PowerQuest  0.15.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 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]
 
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...
 
GuiControl GetControl (string name)
 
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)

◆ 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.

◆ 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.

◆ 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>