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参数

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);
}
Page last updated: 2011-1-14