unity3D技术之guilayout.horizontalscrollbar水平滚动条

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

unity3D技术之guilayout.horizontalscrollbar⽔平滚动条parameters参数
value
the position between min and max
在最⼩最⼤之间的位置(⽂章出⾃狗刨学习⽹)
size
how much can we see?
我们能看到的⼤⼩?
leftvalue
the value at the left end of the scrollbar
滚动条左边末端的值。

rightvalue
the value at the right end of the scrollbar
滚动条右边末端的值。

style
the style to use for the scrollbar background. if left out, the horizontalscrollbar style from the current guiskin is used.
⽤于滚动条背景的样式。

如果不使⽤,该⽔平滚动条使⽤当前的guiskin⽪肤
options
an 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,gui
layout.maxheight,guilayout.expandwidth,guilayout.expandheight
returns
float - the modified value. this can be changed by the user by dragging the scrollbar, or clicking the arrows at the end.
返回浮点型,被修改的值。

这能通过⽤户拖动滚动条,或点击滚动条上的箭头来改变值。

description描述
make a hopriztonal scrollbar. scrollbars are what you use to scroll through a document. most likely, you want to use scroll views instead.
创建⽔平滚动条。

滚动条是能通过滚动来浏览⽂档,⼤多数情况下,你可以使⽤scrollview 代替。

horizontal scrollbar in the game view.
在游戏视图中的⽔平滚动条。

c#
javascript
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);
}
finding extra elements 查找额外的元素:
the styles of the buttons at the end of the scrollbar are searched for in the current skin by adding "leftbutton" and "rightbutton" to the style name. the name of the scrollbar thumb (the thing you drag) is found by appending "thumb" to the style name.
滚动条两端的按钮的样式是在当前⽪肤中搜索"leftbutton"和"rightbutton"样式名字确定。

滚动条滑块的样式是搜索"thumb"的样式名。

var scrollpos : float = 0.5;
// this will use the following style names to determine the size / placement of the buttons
//这将使⽤跟随的样式名字来确定按钮的⼤⼩/ 放置
// myscrollbarleftbutton - name of style used for the left button.
//myscrollbarleftbutton - ⽤于左边按钮样式的名字
// myscrollbarrightbutton - name of style used for the right button.
//myscrollbarrightbutton - ⽤于右边按钮样式的名字
// myscrollbarthumb - name of style used for the draggable thumb.
//myscrollbarthumb - ⽤于拖动滑块样式的名字
function ongui() {
scrollpos = guilayout.horizontalscrollbar (scrollpos, 1, 0, 100, "myscrollbar"); }。

相关文档
最新文档