GUIElement Class
A class for manipulating GUI elements on the Canvas.
How to Get GUIElement
hsCanvasGetGUIElement
GUIElement hsCanvasGetGUIElement(string LayerName, string GUIName)
The GUI element search is performed on the Layer in the current rotation orientation (portrait or landscape).
If the GUI element specified by LayerName or GUIName argument is not found, it returns null.
Layer.GetGUIElement
GUIElement GetGUIElement(string GUIName)
Since a Layer class is either portrait or landscape, the GUI element obtained is performed on that Layer.
GUIElement Methods
GUIElement
GUIElement()
ToString
string ToString()
GetName
string GetName()
SetShow
bool SetShow(bool Show)
Returns false if the GUI type does not support this method call.
GUI types that can call this method
- button
- image
- slider
- text
IsShow
bool IsShow()
GUI types that can call this method
- button
- image
- slider
- text
SetPos
bool SetPos(float X, float Y)
Returns false if the GUI type does not support this method call.
GUI types that can call this method
- button
- image
- slider
- text
GetPos
bool GetPos(ref float X, ref float Y)
Returns false if the GUI type does not support this method call.
GUI types that can call this method
- button
- image
- slider
- text
SetSize
bool SetSize(float Width, float Height)
Returns false if the GUI type does not support this method call.
GUI types that can call this method
- button
- image
- slider
- text
GetSize
bool GetSize(ref float Width, ref float Height)
Returns false if the GUI type does not support this method call.
GUI types that can call this method
- button
- image
- slider
- text
SetText
bool SetText(string Text)
Returns false if the GUI type does not support this method call.
GUI types that can call this method
- button
- text
GetText
bool GetText(ref string Text)
Returns false if the GUI type does not support this method call.
GUI types that can call this method
- button
- text
SetTextColor
bool SetTextColor(float R, float G, float B, float A)
Returns false if the GUI type does not support this method call.
GUI types that can call this method
- button
- text
SetTextAlignment
bool SetTextAlignment(int Alignment)
Returns false if the GUI type does not support this method call.
The following constants can be used for the Alignment argument:
const int GUI_TEXT_ALIGNMENT_LEFT = 0;
const int GUI_TEXT_ALIGNMENT_CENTER = 1;
const int GUI_TEXT_ALIGNMENT_RIGHT = 2;
GUI types that can call this method
- text
SetTextOverflowWrap
bool SetTextOverflowWrap(bool OverflowWrap)
Returns false if the GUI type does not support this method call.
GUI types that can call this method
- text
SetTextURLClickable
bool SetTextURLClickable(bool URLClickable)
Returns false if the GUI type does not support this method call.
GUI types that can call this method
- text
SetImage
bool SetImage(string Path)
Returns false if the GUI type does not support this method call.
GUI types that can call this method
- button
- image
SetSliderRate
bool SetSliderRate(float Rate)
When the slider value is set, the OnSliderRateChanged callback of the component is called.
The available values for the Rate argument are in the range of 0 to 1, and values outside the range are rounded to the nearest value. (For example, setting -10 is rounded to 0, and setting +50 is rounded to 1)
GUI types that can call this method
- slider
SetSliderRateWithoutNotify
bool SetSliderRateWithoutNotify(float Rate)
This method is almost equivalent to SetSliderRate, but does not call the OnSliderRateChanged callback of the component.
GUI types that can call this method
- slider
GetSliderRate
bool GetSliderRate(ref float Rate)
Returns false if the GUI type does not support this method call.
GUI types that can call this method
- slider