GUILayout.RepeatButtonstatic function RepeatButton (image : Texture, params options : GUILayoutOption[]) : booleanstatic function RepeatButton (text : String, params options : GUILayoutOption[]) : booleanstatic function RepeatButton (content : GUIContent, params options : GUILayoutOption[]) : booleanstatic function RepeatButton (image : Texture, style : GUIStyle, params options : GUILayoutOption[]) : booleanstatic function RepeatButton (text : String, style : GUIStyle, params options : GUILayoutOption[]) : booleanstatic function RepeatButton (content : GUIContent, style : GUIStyle, params options : GUILayoutOption[]) : booleanParameters
Returnsboolean - /true/ when the holds down the mouse DescriptionMake a repeating button. The button returns true as long as the user holds down the mouse
JavaScripts
// Draws a button with an image and a button with text
var tex : Texture; function OnGUI() { if(!tex) { Debug.LogError("No texture found, please assign a texture on the inspector"); } if(GUILayout.RepeatButton (tex)) { Debug.Log("Clicked the image"); } if(GUILayout.RepeatButton ("I am a regular Automatic Layout Button")) { Debug.Log("Clicked Button"); } } using UnityEngine;
using System.Collections; public class example : MonoBehaviour { public Texture tex; void OnGUI() { if (!tex) Debug.LogError("No texture found, please assign a texture on the inspector"); if (GUILayout.RepeatButton(tex)) Debug.Log("Clicked the image"); if (GUILayout.RepeatButton("I am a regular Automatic Layout Button")) Debug.Log("Clicked Button"); } } import UnityEngine
import System.Collections class example(MonoBehaviour): public tex as Texture def OnGUI(): if not tex: Debug.LogError('No texture found, please assign a texture on the inspector') if GUILayout.RepeatButton(tex): Debug.Log('Clicked the image') if GUILayout.RepeatButton('I am a regular Automatic Layout Button'): Debug.Log('Clicked Button') |

