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
public class YauiScrollView : MonoBehaviour, IInitializePotentialDragHandler, IBeginDragHandler, IDragHandler, IEndDragHandler, IScrollHandler
Implements:
IInitializePotentialDragHandler, IBeginDragHandler, IDragHandler, IEndDragHandler, IScrollHandler
Properties
Content
View Source
public YauiElement Content { get; set; }
Viewport
View Source
public YauiElement Viewport { get; set; }
Horizontal
View Source
public bool Horizontal { get; set; }
Vertical
View Source
public bool Vertical { get; set; }
MovementType
View Source
public ScrollMovement MovementType { get; set; }
Elasticity
View Source
public float Elasticity { get; set; }
Inertia
View Source
public bool Inertia { get; set; }
DecelerationRate
View Source
public float DecelerationRate { get; set; }
ScrollSensitivity
View Source
public float ScrollSensitivity { get; set; }
HorizontalScrollbar
View Source
public YauiScrollbar HorizontalScrollbar { get; set; }
VerticalScrollbar
View Source
public YauiScrollbar VerticalScrollbar { get; set; }
OnValueChanged
Invoked with Yaui.YauiScrollView.NormalizedPosition when the content moves.
View Source
public YauiScrollView.ScrollViewEvent OnValueChanged { get; set; }
Velocity
View Source
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
public Vector2 ScrollPosition { get; set; }
ScrollRange
How far the content can scroll on each axis.
View Source
public Vector2 ScrollRange { get; }
NormalizedPosition
The scroll position as a fraction of Yaui.YauiScrollView.ScrollRange (0 at the top-left).
View Source
public Vector2 NormalizedPosition { get; set; }
Methods
StopMovement()
View Source
public void StopMovement()
ScrollIntoView(YauiElement)
Scrolls as little as needed to show a descendant of the content.
View Source
public void ScrollIntoView(YauiElement target)
Parameters
| Type | Name |
|---|---|
| Yaui.YauiElement | target |
OnEnable()
View Source
protected virtual void OnEnable()
OnDisable()
View Source
protected virtual void OnDisable()
OnInitializePotentialDrag(PointerEventData)
View Source
public virtual void OnInitializePotentialDrag(PointerEventData eventData)
Parameters
| Type | Name |
|---|---|
PointerEventData | eventData |
OnBeginDrag(PointerEventData)
View Source
public virtual void OnBeginDrag(PointerEventData eventData)
Parameters
| Type | Name |
|---|---|
PointerEventData | eventData |
OnDrag(PointerEventData)
View Source
public virtual void OnDrag(PointerEventData eventData)
Parameters
| Type | Name |
|---|---|
PointerEventData | eventData |
OnEndDrag(PointerEventData)
View Source
public virtual void OnEndDrag(PointerEventData eventData)
Parameters
| Type | Name |
|---|---|
PointerEventData | eventData |
OnScroll(PointerEventData)
View Source
public virtual void OnScroll(PointerEventData eventData)
Parameters
| Type | Name |
|---|---|
PointerEventData | eventData |
LateUpdate()
View Source
protected virtual void LateUpdate()
Implements
IInitializePotentialDragHandlerIBeginDragHandlerIDragHandlerIEndDragHandlerIScrollHandler