UI.ToggleAt
static bool ToggleAt(string text, Boolean& value, Vec3 topLeftCorner, Vec2 size)
A variant of UI.Toggle that doesn’t use the layout system, and instead goes exactly where you put it.
string text | Text to display on the Toggle and id for tracking element state. MUST be unique within current hierarchy. |
Boolean& value | The current state of the toggle button! True means it’s toggled on, and false means it’s toggled off. |
Vec3 topLeftCorner | This is the top left corner of the UI element relative to the current Hierarchy. |
Vec2 size | The layout size for this element in Hierarchy space. |
RETURNS: bool | Will return true any time the toggle value changes, NOT the toggle value itself! |
static bool ToggleAt(string text, Boolean& value, Sprite image, UIBtnLayout imageLayout, Vec3 topLeftCorner, Vec2 size)
A variant of UI.Toggle that doesn’t use the layout system, and instead goes exactly where you put it.
string text | Text to display on the Toggle and id for tracking element state. MUST be unique within current hierarchy. |
Boolean& value | The current state of the toggle button! True means it’s toggled on, and false means it’s toggled off. |
Sprite image | Image to use for the button, this will be used regardless of the toggle value. |
UIBtnLayout imageLayout | This enum specifies how the text and image should be laid out on the button. For example, UIBtnLayout.Left will have the image on the left, and text on the right. |
Vec3 topLeftCorner | This is the top left corner of the UI element relative to the current Hierarchy. |
Vec2 size | The layout size for this element in Hierarchy space. |
RETURNS: bool | Will return true any time the toggle value changes, NOT the toggle value itself! |
static bool ToggleAt(string text, Boolean& value, Sprite toggleOff, Sprite toggleOn, UIBtnLayout imageLayout, Vec3 topLeftCorner, Vec2 size)
A variant of UI.Toggle that doesn’t use the layout system, and instead goes exactly where you put it.
string text | Text to display on the Toggle and id for tracking element state. MUST be unique within current hierarchy. |
Boolean& value | The current state of the toggle button! True means it’s toggled on, and false means it’s toggled off. |
Sprite toggleOff | Image to use when the toggle value is false. |
Sprite toggleOn | Image to use when the toggle value is true. |
UIBtnLayout imageLayout | This enum specifies how the text and image should be laid out on the button. For example, UIBtnLayout.Left will have the image on the left, and text on the right. |
Vec3 topLeftCorner | This is the top left corner of the UI element relative to the current Hierarchy. |
Vec2 size | The layout size for this element in Hierarchy space. |
RETURNS: bool | Will return true any time the toggle value changes, NOT the toggle value itself! |
Found an issue with these docs, or have some additional questions? Create an Issue on Github!