Scripting API

ScrollRect

class in UnityEngine.UI · UnityEngine.UI · inherits from UIBehaviour

55 of 56 of Unity's members
In Tassix

A scroll view: dragging or the scroll wheel moves its content inside the viewport, clamped to the content's edges, springing back elastically, or unrestricted; released, it keeps moving with inertia. Scrollbars follow it and move it.

Properties 27

RectTransform? content { get; set; }
float decelerationRate { get; set; }
float elasticity { get; set; }
virtual float flexibleHeight { get; }
virtual float flexibleWidth { get; }
bool horizontal { get; set; }
float horizontalNormalizedPosition { get; set; }

0 with the content's left edge in view, 1 with its right edge.

Scrollbar? horizontalScrollbar { get; set; }
float horizontalScrollbarSpacing { get; set; }
ScrollbarVisibility horizontalScrollbarVisibility { get; set; }
bool inertia { get; set; }
virtual int layoutPriority { get; }
virtual float minHeight { get; }
virtual float minWidth { get; }
MovementType movementType { get; set; }
Vector2 normalizedPosition { get; set; }
ScrollRectEvent onValueChanged { get; set; }
virtual float preferredHeight { get; }
virtual float preferredWidth { get; }
float scrollSensitivity { get; set; }
Vector2 velocity { get; set; }
bool vertical { get; set; }
float verticalNormalizedPosition { get; set; }

0 with the content's bottom edge in view, 1 with its top edge.

Scrollbar? verticalScrollbar { get; set; }
float verticalScrollbarSpacing { get; set; }
ScrollbarVisibility verticalScrollbarVisibility { get; set; }
RectTransform? viewport { get; set; }

Methods 14

virtual void CalculateLayoutInputHorizontal()
virtual void CalculateLayoutInputVertical()
virtual void GraphicUpdateComplete()
bool IsActive()
virtual void LayoutComplete()
virtual void OnBeginDrag(PointerEventData eventData)
virtual void OnDrag(PointerEventData eventData)

The content follows the pointer from where the drag began; past an edge, clamped or stretched like rubber.

virtual void OnEndDrag(PointerEventData eventData)
virtual void OnInitializePotentialDrag(PointerEventData eventData)
virtual void OnScroll(PointerEventData data)
virtual void Rebuild(CanvasUpdate executing)
virtual void SetLayoutHorizontal()

Auto-hiding scrollbars that expand the viewport take its width or height when shown.

virtual void SetLayoutVertical()
virtual void StopMovement()

Not in Tassix yet 1

OnValidate

Checked against Unity

Conformance scenarios that exercise it, recorded in Unity and compared event by event.