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.HorizontalSlider 水平滑动条
static function HorizontalSlider (position : Rect, value : float, leftValue : float, rightValue : float) : float
static function HorizontalSlider (position : Rect, value : float, leftValue : float, rightValue : 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.
显示滑动条的值,它确定了可拖动滑块的位置。 - 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.
用于显示可拖动区域GUI样式,如果不使用,则水平滑动区域的样式应用当前GUISkin皮肤 - thumbThe GUIStyle to use for displaying draggable thumb. If left out, the horizontalSliderThumb style from the current GUISkin is used.
用于显示可拖动滑块的GUI样式,如果不使用,则水平滑块样式应用当前的GUISkin皮肤
float - The value that has been set by the user.
返回float类型,已被用户设置的值。
Description描述
A horizontal 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 hSliderValue = 0.0F;
void OnGUI() {
hSliderValue = GUI.HorizontalSlider(new Rect(25, 25, 100, 30), hSliderValue, 0.0F, 10.0F);
}
}
// Draws a horizontal slider control that goes from 0 to 10.
//绘制一个从0-10的水平滑动条控件
var hSliderValue : float = 0.0;
function OnGUI () {
hSliderValue = GUI.HorizontalSlider(Rect (25, 25, 100, 30), hSliderValue, 0.0, 10.0);
}
最后修改:2011年10月19日 Wednesday 22:12