日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

Unity2017.1官方UGUI文档翻译——Scrollbar

發布時間:2025/7/25 编程问答 18 豆豆
生活随笔 收集整理的這篇文章主要介紹了 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控件用來選擇數字,Scrollbar是用來滾動的。熟悉的例子包括文字編輯器旁邊的垂直滾動條和一對垂直、水平滾動條來查看一張大圖或者地圖的一部分。

A Scrollbar.

一個滾動條

Properties

屬性

Property:Function:
InteractableWill this component accept input? See?Interactable.
Transition

Properties that determine the way the control responds visually to user actions.

See?Transition Options.

NavigationProperties that determine the sequence of controls. See?Navigation Options.
Fill RectThe graphic used for the background area of the control.
Handle RectThe 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.

ValueInitial position value of the Scrollbar, in the range 0.0 to 1.0.
SizeFractional size of the handle within the Scrollbar, in the range 0.0 to 1.0.
Number Of StepsThe number of distinct scroll positions allowed by the Scrollbar.
屬性功能
Interactable這個組件是否會接受輸入? 請參閱?Interactable.
Transition

確定控件如何對用戶操作進行可視化響應的屬性。

請參閱Transition Options.

Navigation確定控件導航時對不同方向的響應。請參閱?Navigation Options.
Fill Rect用于控件的填充區域的圖片(Graphic類型)
Handle Rect用于滑動塊的圖片(Graphic類型)
Direction

拖動滑塊時,填充的圖片擴張的方向。 選項是Left To Right,?Right To Left,?

Bottom To Top?和?Top To Bottom

Value

Scrollbar的初始位置值,范圍在0.0到1.0之間

Size

滾動條內的滑塊占總長度的比例,在0.0到1.0之間

Number Of Steps

滾動條所允許的不同滾動位置的數量(可以理解為滑塊可以拖動到的幾個固定位置。

比如說這個值是5,那么這個滑塊只能拖動到(0,1/4,2/4,3/4,1)其它比例都滑不到

Events

事件

Property:Function:
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

當Slider當前的值發生變化時會調用一個UnityEvent。

這個事件可以將當前值作為一個float類型動態參數發出去。

?

Details

詳細

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的值取決于滑塊沿著其長度的位置,該值被表示為占最大長度的分數。比如,默認的從左到右的欄的左端為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控件之間的顯著區別在于Scrollbar的滑塊可以改變大小以表示可用的滾動距離; 當視圖只能滾動一小段時,滑塊將填滿大部分欄,只允許輕微向任一方向移動。

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,當用戶拖拽滑塊時調用。當前的值作為一個float參數傳到事件函數中。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.
  • 垂直滾動一段文字
  • 水平滾動時間線
  • 作為一對使用,在水平和垂直方向上滾動大圖以查看放大的部分。?滑塊的大小會發生變化表示縮放的程度,從而表示可以滾動的距離。

轉載于:https://www.cnblogs.com/SolarWings/p/8185568.html

總結

以上是生活随笔為你收集整理的Unity2017.1官方UGUI文档翻译——Scrollbar的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。