GUILayout
- BeginArea
- BeginHorizontal
- BeginScrollView
- BeginVertical
- Box
- Button
- EndArea
- EndHorizontal
- EndScrollView
- EndVertical
- ExpandHeight
- ExpandWidth
- FlexibleSpace
- Height
- HorizontalScrollbar
- HorizontalSlider
- Label
- MaxHeight
- MaxWidth
- MinHeight
- MinWidth
- PasswordField
- RepeatButton
- SelectionGrid
- Space
- TextArea
- TextField
- Toggle
- Toolbar
- VerticalScrollbar
- VerticalSlider
- Width
- Window
GUILayout.HorizontalSlider 水平滑动条
static function HorizontalSlider (value : float, leftValue : float, rightValue : float, params options : GUILayoutOption[]) : float
static function HorizontalSlider (value : float, leftValue : float, rightValue : float, slider : GUIStyle, thumb : GUIStyle, params options : GUILayoutOption[]) : float
Parameters参数
-
valueThe value the slider shows. This determines the position of the draggable thumb.
滑动条显示的值,这个确定拖动滑块的位置。 -
leftValueThe value at the left end of the slider.
滑动条左边末端的值。 -
rightValueThe value at the right end of the slider.
滑动条右边末端的值。 -
sliderThe GUIStyle to use for displaying the dragging area. If left out, the horizontalSlider style from the current GUISkin is used.
用于拖动区域的GUIStyle样式。如果不使用,该水平滑动条使用当前的GUISkin皮肤 -
optionsAn optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.
布局选项指定额外布局属性的一个可选列表。这里传递任意值都将覆盖由style定义的设置。
参考: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight
float - The value that has been set by the user.
返回浮点型,已经由用户设置的值。
Description描述
A horizontal slider the user can drag to change a value between a min and a max.
创建一个水平滑动条,用户可以拖动改变在最小和最大值之间的值。
Horizontal slider in the GameView.
在游戏视图中的水平滑动条。
using UnityEngine;
using System.Collections;
public class example : MonoBehaviour {
public float hSliderValue = 0.0F;
void OnGUI() {
hSliderValue = GUILayout.HorizontalSlider(hSliderValue, 0.0F, 10.0F);
}
}
var hSliderValue : float = 0.0;
function OnGUI () {
hSliderValue = GUILayout.HorizontalSlider (hSliderValue, 0.0, 10.0);
}
最后修改:2011年6月14日 Tuesday 15:06