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.VerticalSlider 垂直滑动条
static function VerticalSlider (value : float, topValue : float, bottomValue : float, params options : GUILayoutOption[]) : float
static function VerticalSlider (value : float, topValue : float, bottomValue : float, slider : GUIStyle, thumb : GUIStyle, params options : GUILayoutOption[]) : float
Parameters参数
-
valueThe value the slider shows. This determines the position of the draggable thumb.
滑动条显示的值,这个确定拖动滑块的位置。 -
topValueThe value at the top end of the slider.
滑动条上部末端的值。 -
bottomValueThe value at the bottom end of the slider.
滑动条下部末端的值。 -
sliderThe GUIStyle to use for displaying the dragging area. If left out, the VerticalSlider 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 vertical slider the user can drag to change a value between a min and a max.
创建一个垂直滑动条,用户可以拖动改变在最小和最大值之间的值。
Vertical slider in the Game View.
在游戏视图中的垂直滑动条。
using UnityEngine;
using System.Collections;
public class example : MonoBehaviour {
public float vSliderValue = 0.0F;
void OnGUI() {
vSliderValue = GUILayout.VerticalSlider(vSliderValue, 10.0F, 0.0F);
}
}
// Draws a vertical slider control that goes from 10 (top) to 0 (bottom)
//绘制一个垂直滑动条控件,值从10.0~0
var vSliderValue : float = 0.0;
function OnGUI () {
vSliderValue = GUILayout.VerticalSlider (vSliderValue, 10.0, 0.0);
}
最后修改:2011年6月14日 Tuesday 14:28