GUI
- backgroundColor
- BeginGroup
- BeginScrollView
- Box
- BringWindowToBack
- BringWindowToFront
- Button
- changed
- color
- contentColor
- depth
- DragWindow
- DrawTexture
- enabled
- EndGroup
- EndScrollView
- FocusControl
- FocusWindow
- GetNameOfFocusedControl
- GUI
- HorizontalScrollbar
- HorizontalSlider
- Label
- matrix
- PasswordField
- RepeatButton
- ScrollTo
- SelectionGrid
- SetNextControlName
- skin
- TextArea
- TextField
- Toggle
- Toolbar
- tooltip
- UnfocusWindow
- VerticalScrollbar
- VerticalSlider
- Window
GUI.VerticalSlider 垂直滑动条
static function VerticalSlider (position : Rect, value : float, topValue : float, bottomValue : float) : float
static function VerticalSlider (position : Rect, value : float, topValue : float, bottomValue : float, slider : GUIStyle, thumb : GUIStyle) : float
Parameters参数
- positionRectangle on the screen to use for the slider.
用于滑动条在屏幕上的矩形位置。 - 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.
用于显示可拖动区域GUI样式,如果不使用,则垂直滑动区域的样式应用当前GUISkin皮肤 - thumbThe GUIStyle to use for displaying draggable thumb. If left out, the VerticalSliderThumb style from the current GUISkin is used.
用于显示可拖动滑块的GUI样式,如果不使用,则垂直滑块样式应用当前的GUISkin皮肤
Returns
float - The value that has been set by the user.
返回float类型,已被用户设置的值。
Description描述
A vertical slider the user can drag to change a value between a min and a max.
垂直滑动条,用户能拖动改变最小和最大值之间。
using UnityEngine;
using System.Collections;
public class example : MonoBehaviour {
public float vSliderValue = 0.0F;
void OnGUI() {
vSliderValue = GUI.VerticalSlider (new Rect(25, 25, 100, 30), vSliderValue, 10.0F, 0.0F);
}
}
// Draws a vertical slider control that goes from 10 (top) to 0 (bottom)
//绘制一个从10到0的垂直滑动条
var vSliderValue : float = 0.0;
function OnGUI () {
vSliderValue = GUI.VerticalSlider (Rect (25, 25, 100, 30), vSliderValue, 10.0, 0.0);
}
最后修改:2011年1月14日 Friday 22:24