Back to API Reference
Class

UniTextDocumentView

sealed
Inherits:UIBehaviour
Implements:IInitializePotentialDragHandlerIBeginDragHandlerIDragHandlerIEndDragHandlerIScrollHandler

Provides a viewport, drag and wheel scrolling, inertia, elastic edges and optional scrollbars for Canvas text of any length; drives the text RectTransform to fill this view.

Nested Types

public UniText Text{ get; set }
public Scrollbar VerticalScrollbar{ get; set }
public Scrollbar HorizontalScrollbar{ get; set }
public StartEdge StartAt{ get; set }
public double Position{ get; set }

Document Y at the viewport's top edge; setting it teleports there, clamped to the document, and stops any movement.

public void ScrollToStart()

Shows the document's start.

public void ScrollToEnd()

Shows the document's end.

public void StopMovement()

Ends inertia; an overshoot still springs back.

protected override void OnEnable()
protected override void OnDisable()
protected override void OnRectTransformDimensionsChange()
public void OnInitializePotentialDrag()
public void OnBeginDrag()
public void OnDrag()

The content follows the pointer by its movement since the last event, and the velocity a drag leaves behind is measured from that movement, so a block measured meanwhile — which moves the document's numbers, not the content — jolts neither.

public void OnEndDrag()
public void OnScroll()