C# Class UIScrollView, TheUnseen

Inheritance: MonoBehaviour
Show file Open project: henryj41043/TheUnseen Class Usage Examples

Public Properties

Property Type Description
contentPivot UIWidget.Pivot
customMovement Vector2
disableDragIfFits bool
dragEffect DragEffect
horizontalScrollBar UIProgressBar,
iOSDragEmulation bool
list BetterList
momentumAmount float
movement Movement,
onDragFinished OnDragFinished
restrictWithinPanel bool
scrollWheelFactor float
showScrollBars ShowCondition
smoothDragStart bool
verticalScrollBar UIProgressBar,

Public Methods

Method Description
DisableSpring ( ) : void

Disable the spring movement.

Drag ( ) : void

Drag the object along the plane.

MoveAbsolute ( Vector3 absolute ) : void

Move the scroll view by the specified amount.

MoveRelative ( Vector3 relative ) : void

Move the scroll view by the specified amount.

OnScrollBar ( ) : void

Triggered by the scroll bars when they change.

Press ( bool pressed ) : void

Create a plane on which we will be performing the dragging.

RestrictWithinBounds ( bool instant ) : bool

Restrict the scroll view's contents to be within the scroll view's bounds.

RestrictWithinBounds ( bool instant, bool horizontal, bool vertical ) : bool

Restrict the scroll view's contents to be within the scroll view's bounds.

Scroll ( float delta ) : void

If the object should support the scroll wheel, do it.

SetDragAmount ( float x, float y, bool updateScrollbars ) : void

Changes the drag amount of the scroll view to the specified 0-1 range values. (0, 0) is the top-left corner, (1, 1) is the bottom-right.

UpdatePosition ( ) : void

Call this function after you adjust the scroll view's bounds if you want it to maintain the current scrolled position

UpdateScrollbars ( bool recalculateBounds ) : void

Update the values of the associated scroll bars.

Private Methods

Method Description
Awake ( ) : void

Cache the transform and the panel.

LateUpdate ( ) : void

Apply the dragging momentum.

OnDisable ( ) : void
OnDrawGizmos ( ) : void

Draw a visible orange outline of the bounds.

OnEnable ( ) : void
ResetPosition ( ) : void
Start ( ) : void

Set the initial drag value and register the listener delegates.

UpdateScrollbars ( UIScrollBar, sb, float contentMin, float contentMax, float contentSize, float viewSize, bool inverted ) : void

Helper function used in UpdateScrollbars(float) function above.

Method Details

DisableSpring() public method

Disable the spring movement.
public DisableSpring ( ) : void
return void

Drag() public method

Drag the object along the plane.
public Drag ( ) : void
return void

MoveAbsolute() public method

Move the scroll view by the specified amount.
public MoveAbsolute ( Vector3 absolute ) : void
absolute Vector3
return void

MoveRelative() public method

Move the scroll view by the specified amount.
public MoveRelative ( Vector3 relative ) : void
relative Vector3
return void

OnScrollBar() public method

Triggered by the scroll bars when they change.
public OnScrollBar ( ) : void
return void

Press() public method

Create a plane on which we will be performing the dragging.
public Press ( bool pressed ) : void
pressed bool
return void

RestrictWithinBounds() public method

Restrict the scroll view's contents to be within the scroll view's bounds.
public RestrictWithinBounds ( bool instant ) : bool
instant bool
return bool

RestrictWithinBounds() public method

Restrict the scroll view's contents to be within the scroll view's bounds.
public RestrictWithinBounds ( bool instant, bool horizontal, bool vertical ) : bool
instant bool
horizontal bool
vertical bool
return bool

Scroll() public method

If the object should support the scroll wheel, do it.
public Scroll ( float delta ) : void
delta float
return void

SetDragAmount() public method

Changes the drag amount of the scroll view to the specified 0-1 range values. (0, 0) is the top-left corner, (1, 1) is the bottom-right.
public SetDragAmount ( float x, float y, bool updateScrollbars ) : void
x float
y float
updateScrollbars bool
return void

UpdatePosition() public method

Call this function after you adjust the scroll view's bounds if you want it to maintain the current scrolled position
public UpdatePosition ( ) : void
return void

UpdateScrollbars() public method

Update the values of the associated scroll bars.
public UpdateScrollbars ( bool recalculateBounds ) : void
recalculateBounds bool
return void

Property Details

contentPivot public property

Content's pivot point -- where it originates from by default.
public UIWidget.Pivot contentPivot
return UIWidget.Pivot

customMovement public property

Custom movement, if the 'movement' field is set to 'Custom'.
public Vector2 customMovement
return Vector2

disableDragIfFits public property

Whether dragging will be disabled if the contents fit.
public bool disableDragIfFits
return bool

dragEffect public property

Effect to apply when dragging.
public DragEffect dragEffect
return DragEffect

horizontalScrollBar public property

Horizontal scrollbar used for visualization.
public UIProgressBar, horizontalScrollBar
return UIProgressBar,

iOSDragEmulation public property

Whether to use iOS drag emulation, where the content only drags at half the speed of the touch/mouse movement when the content edge is within the clipping area.
public bool iOSDragEmulation
return bool

list static public property

static public BetterList list
return BetterList

momentumAmount public property

How much momentum gets applied when the press is released after dragging.
public float momentumAmount
return float

movement public property

Type of movement allowed by the scroll view.
public Movement, movement
return Movement,

onDragFinished public property

Event callback to trigger when the drag process finished. Can be used for additional effects, such as centering on some object.
public OnDragFinished onDragFinished
return OnDragFinished

restrictWithinPanel public property

Whether the dragging will be restricted to be within the scroll view's bounds.
public bool restrictWithinPanel
return bool

scrollWheelFactor public property

Effect the scroll wheel will have on the momentum.
public float scrollWheelFactor
return float

showScrollBars public property

Condition that must be met for the scroll bars to become visible.
public ShowCondition showScrollBars
return ShowCondition

smoothDragStart public property

Whether the drag operation will be started smoothly, or if if it will be precise (but will have a noticeable "jump").
public bool smoothDragStart
return bool

verticalScrollBar public property

Vertical scrollbar used for visualization.
public UIProgressBar, verticalScrollBar
return UIProgressBar,