‪TechbloxModdingAPI  ‪v2.2.0
‪The unofficial Techblox modding API
TechbloxModdingAPI.Interface.IMGUI.Button Class Reference

‪A clickable button. This wraps Unity's IMGUI Button. More...

Inheritance diagram for TechbloxModdingAPI.Interface.IMGUI.Button:
TechbloxModdingAPI.Interface.IMGUI.UIElement

Public Member Functions

 Button (string text, Rect box, string name=null)
 ‪Initialize a new button. More...
 
 Button (string text, string name=null)
 ‪Initialize a new button with automatic layout. More...
 
override void OnGUI ()
 ‪GUI operations to perform in the OnGUI scope. This is basically equivalent to a MonoBehaviour's OnGUI method. More...
 

Properties

Rect Box = Rect.zero [get, set]
 ‪The rectangular area that the button can use. More...
 
bool Enabled = true [get, set]
 ‪Whether to display the UI element or not. More...
 
string Name [get]
 ‪The element's name. This should be unique for every instance of the class. More...
 

Events

EventHandler< bool > OnClick
 ‪An event that fires when the button is clicked. More...
 

Detailed Description

A clickable button. This wraps Unity's IMGUI Button.

Constructor & Destructor Documentation

◆ Button() [1/2]

TechbloxModdingAPI.Interface.IMGUI.Button.Button ( string  text,
string  name = null 
)
inline

‪Initialize a new button with automatic layout.

Parameters
text‪The text to display on the button.
name‪The button's name.

◆ Button() [2/2]

TechbloxModdingAPI.Interface.IMGUI.Button.Button ( string  text,
Rect  box,
string  name = null 
)
inline

‪Initialize a new button.

Parameters
text‪The text to display on the button.
box‪Rectangular area for the button to use.
name‪The button's name.

Member Function Documentation

◆ OnGUI()

override void TechbloxModdingAPI.Interface.IMGUI.Button.OnGUI ( )
inlinevirtual

‪GUI operations to perform in the OnGUI scope. This is basically equivalent to a MonoBehaviour's OnGUI method.

Implements TechbloxModdingAPI.Interface.IMGUI.UIElement.

Property Documentation

◆ Box

Rect TechbloxModdingAPI.Interface.IMGUI.Button.Box = Rect.zero
getset

‪The rectangular area that the button can use.

◆ Enabled

bool TechbloxModdingAPI.Interface.IMGUI.UIElement.Enabled = true
getsetinherited

‪Whether to display the UI element or not.

◆ Name

string TechbloxModdingAPI.Interface.IMGUI.UIElement.Name
getinherited

‪The element's name. This should be unique for every instance of the class.

Event Documentation

◆ OnClick

EventHandler< bool> TechbloxModdingAPI.Interface.IMGUI.Button.OnClick

‪An event that fires when the button is clicked.


The documentation for this class was generated from the following file: