Unity3D圣典3.3版本-中文版
文集大纲加载中……
本文档使用 MrDoc 发布
-
+
首页
GUI.HorizontalSlider 水平滑动条
# [GUI](GUI.html).HorizontalSlider 水平滑动条 static function *HorizontalSlider* (*position* : [Rect](../Rect/Rect.html), *value* : float, *leftValue* : float, *rightValue* : float) : float static function *HorizontalSlider* (*position* : [Rect](../Rect/Rect.html), *value* : float, *leftValue* : float, *rightValue* : float, *slider* : [GUIStyle](../GUIStyle/GUIStyle.html), *thumb* : [GUIStyle](../GUIStyle/GUIStyle.html)) : float ### Parameters**参数** * *position* Rectangle on the screen to use for the slider. 用于滑动条在屏幕上的矩形位置。 * *value* The value the slider shows. This determines the position of the draggable thumb. 显示滑动条的值,它确定了可拖动滑块的位置。 * *leftValue* The value at the left end of the slider 滑动条最左边的值 * *rightValue* The value at the right end of the slider 滑动条最右边的值 * *slider* The GUIStyle to use for displaying the dragging area. If left out, the horizontalSlider style from the current GUISkin is used. 用于显示可拖动区域 GUI 样式,如果不使用,则水平滑动区域的样式应用当前 GUISkin 皮肤 * *thumb* The GUIStyle to use for displaying draggable thumb. If left out, the horizontalSliderThumb style from the current GUISkin is used. 用于显示可拖动滑块的 GUI 样式,如果不使用,则水平滑块样式应用当前的 GUISkin 皮肤 *Returns* 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. 水平滑动条,用户能拖动改变最小和最大值之间。 * [C#](#) * [JavaScript](#) ``` 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); } ```
da
2022年5月23日 13:47
转发文档
收藏文档
上一篇
下一篇
手机扫码
复制链接
手机扫一扫转发分享
复制链接
关于 MrDoc
觅思文档MrDoc
是
州的先生
开发并开源的在线文档系统,其适合作为个人和小型团队的云笔记、文档和知识库管理工具。
如果觅思文档给你或你的团队带来了帮助,欢迎对作者进行一些打赏捐助,这将有力支持作者持续投入精力更新和维护觅思文档,感谢你的捐助!
>>>捐助鸣谢列表
微信
支付宝
QQ
PayPal
Markdown文件
分享
链接
类型
密码
更新密码