GUI.Toggle Manual     Reference     Scripting  
Scripting > Runtime Classes > GUI
GUI.Toggle

static function Toggle (position : Rect, value : bool, text : string) : bool

static function Toggle (position : Rect, value : bool, image : Texture) : bool

static function Toggle (position : Rect, value : bool, content : GUIContent) : bool

static function Toggle (position : Rect, value : bool, text : string, style : GUIStyle) : bool

static function Toggle (position : Rect, value : bool, image : Texture, style : GUIStyle) : bool

static function Toggle (position : Rect, value : bool, content : GUIContent, style : GUIStyle) : bool

Parameters

NameDescription
position Rectangle on the screen to use for the button.
value Is this button on or off?
text Text to display on the button.
image Texture to display on the button.
content Text, image and tooltip for this button.
style The style to use. If left out, the toggle style from the current GUISkin is used.

Returns

bool - The new value of the button.

Description

Make an on/off toggle button.