- Home /
Size GUiLayout
hi, my problem is this, I have a GUILayout.BeginArea, so far so good, all right, but what I want is to increase the width of the GUI, here is my script:
private var hSliderValue: float = 0.0;
private var myAnimation: AnimationState;
function Start () {
myAnimation = animation ["Take 001"];
}
LateUpdate function () {
myAnimation.time = hSliderValue;
myAnimation.enabled = true;
animation.Sample ();
myAnimation.enabled = false;
}
function OnGUI () {
/ / Horizontal Slider
/ / GUI.Box (Rect (0, Screen.Height - 40, screen.width, 80), "");
GUILayout.BeginArea (Rect (100, Screen.Height - 40,1220,60));
hSliderValue = GUILayout.HorizontalSlider (hSliderValue, 0.0, myAnimation.length, GUILayout.Width (800.0f));
GUILayout.EndArea ();
}
Not sure I follow. You want to increase width of the GUI Area during runtime? The width of the area is defined by the Rect that you pass in the BeginArea() method.
i want to increase the size of the slider button, how can i script that
Don't post comments as answers, use the "Add new comment" button below your original question.
Answer by tigertrussell · Aug 05, 2013 at 02:55 AM
In the GUISkin that you are using, there should be a texture for the slider button. Simply change the texture.
Answer by ryisnelly · Aug 05, 2013 at 02:57 AM
var hSbarValue : float;
function OnGUI () {
hSbarValue = GUI.HorizontalScrollbar (Rect (25, 25, 100, 30), hSbarValue, 1.0, 0.0, 10.0);
}
Your answer
Follow this Question
Related Questions
showing variables 1 Answer
know GUILayout current screen position 2 Answers
How to plot velocity of vehicle wheel collider on realtime graph 0 Answers
CoolDown Animation on the GUI 1 Answer