メインコンテンツまでスキップ

Class YauiScrollView

Scrolls a content element inside a viewport element by dragging, the scroll wheel and scrollbars, like uGUI's ScrollRect. The content moves by its render transform (Yaui.YauiElement.Translate, driven by the scroll view), so scrolling never lays out again. The content keeps its own layout: typically the viewport clips its children, and the content is its absolutely positioned child at the top-left, as wide as the viewport for vertical scrolling, and as tall as its children.

Assembly: Yaui.dll​
View Source​
Declaration
public class YauiScrollView : MonoBehaviour, IInitializePotentialDragHandler, IBeginDragHandler, IDragHandler, IEndDragHandler, IScrollHandler

Implements:
IInitializePotentialDragHandler, IBeginDragHandler, IDragHandler, IEndDragHandler, IScrollHandler

Properties​

Content​

View Source​
Declaration
public YauiElement Content { get; set; }

Viewport​

View Source​
Declaration
public YauiElement Viewport { get; set; }

Horizontal​

View Source​
Declaration
public bool Horizontal { get; set; }

Vertical​

View Source​
Declaration
public bool Vertical { get; set; }

MovementType​

View Source​
Declaration
public ScrollMovement MovementType { get; set; }

Elasticity​

View Source​
Declaration
public float Elasticity { get; set; }

Inertia​

View Source​
Declaration
public bool Inertia { get; set; }

DecelerationRate​

View Source​
Declaration
public float DecelerationRate { get; set; }

ScrollSensitivity​

View Source​
Declaration
public float ScrollSensitivity { get; set; }

HorizontalScrollbar​

View Source​
Declaration
public YauiScrollbar HorizontalScrollbar { get; set; }

VerticalScrollbar​

View Source​
Declaration
public YauiScrollbar VerticalScrollbar { get; set; }

OnValueChanged​

Invoked with Yaui.YauiScrollView.NormalizedPosition when the content moves.

View Source​
Declaration
public YauiScrollView.ScrollViewEvent OnValueChanged { get; set; }

Velocity​

View Source​
Declaration
public Vector2 Velocity { get; set; }

ScrollPosition​

How far the content is scrolled from its laid-out place, in canvas units (positive: toward its end).

View Source​
Declaration
public Vector2 ScrollPosition { get; set; }

ScrollRange​

How far the content can scroll on each axis.

View Source​
Declaration
public Vector2 ScrollRange { get; }

NormalizedPosition​

The scroll position as a fraction of Yaui.YauiScrollView.ScrollRange (0 at the top-left).

View Source​
Declaration
public Vector2 NormalizedPosition { get; set; }

Methods​

StopMovement()​

View Source​
Declaration
public void StopMovement()

ScrollIntoView(YauiElement)​

Scrolls as little as needed to show a descendant of the content.

View Source​
Declaration
public void ScrollIntoView(YauiElement target)
Parameters​
TypeName
Yaui.YauiElementtarget

OnEnable()​

View Source​
Declaration
protected virtual void OnEnable()

OnDisable()​

View Source​
Declaration
protected virtual void OnDisable()

OnInitializePotentialDrag(PointerEventData)​

View Source​
Declaration
public virtual void OnInitializePotentialDrag(PointerEventData eventData)
Parameters​
TypeName
PointerEventDataeventData

OnBeginDrag(PointerEventData)​

View Source​
Declaration
public virtual void OnBeginDrag(PointerEventData eventData)
Parameters​
TypeName
PointerEventDataeventData

OnDrag(PointerEventData)​

View Source​
Declaration
public virtual void OnDrag(PointerEventData eventData)
Parameters​
TypeName
PointerEventDataeventData

OnEndDrag(PointerEventData)​

View Source​
Declaration
public virtual void OnEndDrag(PointerEventData eventData)
Parameters​
TypeName
PointerEventDataeventData

OnScroll(PointerEventData)​

View Source​
Declaration
public virtual void OnScroll(PointerEventData eventData)
Parameters​
TypeName
PointerEventDataeventData

LateUpdate()​

View Source​
Declaration
protected virtual void LateUpdate()

Implements​

  • IInitializePotentialDragHandler
  • IBeginDragHandler
  • IDragHandler
  • IEndDragHandler
  • IScrollHandler