Unity2017.1官方UGUI文档翻译——Scrollbar
Scrollbar
滾動條
The?Scrollbar?control allows the user to scroll an image or other view that is too large to see completely. Note that the similar?Slider?control is used for selecting numeric values rather than scrolling. Familiar examples include the vertical Scrollbar at the side of a text editor and the vertical and horizontal pair of bars for viewing a section of a large image or map.
Scrollbar控件讓用戶可以滾動圖片或者其它視圖,它們太大了,以至于不能一下子看到全部。注意,類似Slider控件用來選擇數(shù)字,Scrollbar是用來滾動的。熟悉的例子包括文字編輯器旁邊的垂直滾動條和一對垂直、水平滾動條來查看一張大圖或者地圖的一部分。
A Scrollbar.
一個滾動條
Properties
屬性
| Interactable | Will this component accept input? See?Interactable. |
| Transition | Properties that determine the way the control responds visually to user actions. See?Transition Options. |
| Navigation | Properties that determine the sequence of controls. See?Navigation Options. |
| Fill Rect | The graphic used for the background area of the control. |
| Handle Rect | The graphic used for the sliding “handle” part of the control |
| Direction | The direction in which the Scrollbar’s value will increase when the handle is dragged. The options are?Left To Right,?Right To Left,?Bottom To Top?and?Top To Bottom. |
| Value | Initial position value of the Scrollbar, in the range 0.0 to 1.0. |
| Size | Fractional size of the handle within the Scrollbar, in the range 0.0 to 1.0. |
| Number Of Steps | The number of distinct scroll positions allowed by the Scrollbar. |
| Interactable | 這個組件是否會接受輸入? 請參閱?Interactable. |
| Transition | 確定控件如何對用戶操作進(jìn)行可視化響應(yīng)的屬性。 請參閱Transition Options. |
| Navigation | 確定控件導(dǎo)航時對不同方向的響應(yīng)。請參閱?Navigation Options. |
| Fill Rect | 用于控件的填充區(qū)域的圖片(Graphic類型) |
| Handle Rect | 用于滑動塊的圖片(Graphic類型) |
| Direction | 拖動滑塊時,填充的圖片擴(kuò)張的方向。 選項是Left To Right,?Right To Left,? Bottom To Top?和?Top To Bottom |
| Value | Scrollbar的初始位置值,范圍在0.0到1.0之間 |
| Size | 滾動條內(nèi)的滑塊占總長度的比例,在0.0到1.0之間 |
| Number Of Steps | 滾動條所允許的不同滾動位置的數(shù)量(可以理解為滑塊可以拖動到的幾個固定位置。 比如說這個值是5,那么這個滑塊只能拖動到(0,1/4,2/4,3/4,1)其它比例都滑不到 |
Events
事件
| On Value Changed | A?UnityEvent?that is invoked when the current value of the Scrollbar changes. The event can send the value as a?float?type dynamic argument. |
| On Value Changed | 當(dāng)Slider當(dāng)前的值發(fā)生變化時會調(diào)用一個UnityEvent。 這個事件可以將當(dāng)前值作為一個float類型動態(tài)參數(shù)發(fā)出去。 |
?
Details
詳細(xì)
The value of a Scrollbar is determined by the position of the handle along its length with the value being reported as a fraction between the extreme ends. For example, the default left-to-right bar has a value of 0.0 at the left end, 1.0 at the right end and 0.5 indicates the halfway point. A scrollbar can be oriented vertically by choosing?Top To Bottom?or?Bottom To Top?for the?Direction?property.
Scrollbar的值取決于滑塊沿著其長度的位置,該值被表示為占最大長度的分?jǐn)?shù)。比如,默認(rèn)的從左到右的欄的左端為0.0,右端為1.0,中間點為0.5。scrollbar可以通過為“方向”屬性選擇“頂部到底部”或“底部到頂部”來面向垂直方向
A significant difference between the Scrollbar and the similar?Slider?control is that the Scrollbar’s handle can change in size to represent the distance of scrolling available; when the view can scroll only a short way, the handle will fill up most of the bar and only allow a slight shift either direction.
Scrollbar和類似的Slider控件之間的顯著區(qū)別在于Scrollbar的滑塊可以改變大小以表示可用的滾動距離; 當(dāng)視圖只能滾動一小段時,滑塊將填滿大部分欄,只允許輕微向任一方向移動。
The Scrollbar has a single event called?On Value Changed?that responds as the user drags the handle. The current value is passed to the even function as a?float?parameter. Typical use cases for a scrollbar include:
Scrollbar有一個事件叫做On Value Changed,當(dāng)用戶拖拽滑塊時調(diào)用。當(dāng)前的值作為一個float參數(shù)傳到事件函數(shù)中。Scrollbar典型的用例包括:
- Scrolling a piece of text vertically.
- Scrolling a timeline horizontally.
- Used as a pair, scrolling a large image both horizontally and vertically to view a zoomed section. The size of the handle changes to indicate the degree of zooming and therefore the available distance for scrolling.
- 垂直滾動一段文字
- 水平滾動時間線
- 作為一對使用,在水平和垂直方向上滾動大圖以查看放大的部分。?滑塊的大小會發(fā)生變化表示縮放的程度,從而表示可以滾動的距離。
轉(zhuǎn)載于:https://www.cnblogs.com/SolarWings/p/8185568.html
總結(jié)
以上是生活随笔為你收集整理的Unity2017.1官方UGUI文档翻译——Scrollbar的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: jmeter的基本功能使用详解
- 下一篇: 11. 日期和时间