This script, when attached to a panel turns it into a scroll view. You can then attach UIDragScrollView to colliders within to make it draggable.
More...
|
delegate void | OnDragNotification () |
|
bool | RestrictWithinBounds (bool instant) |
| Restrict the scroll view's contents to be within the scroll view's bounds. More...
|
|
bool | RestrictWithinBounds (bool instant, bool horizontal, bool vertical) |
| Restrict the scroll view's contents to be within the scroll view's bounds. More...
|
|
void | DisableSpring () |
| Disable the spring movement. More...
|
|
void | UpdateScrollbars () |
| Update the values of the associated scroll bars. More...
|
|
virtual void | UpdateScrollbars (bool recalculateBounds) |
| Update the values of the associated scroll bars. More...
|
|
virtual void | SetDragAmount (float x, float y, bool updateScrollbars) |
| 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. More...
|
|
void | InvalidateBounds () |
| Manually invalidate the scroll view's bounds so that they update next time. More...
|
|
void | ResetPosition () |
| Reset the scroll view's position to the top-left corner. It's recommended to call this function before AND after you re-populate the scroll view's contents (ex: switching window tabs). Another option is to populate the scroll view's contents, reset its position, then call this function to reposition the clipping. More...
|
|
void | UpdatePosition () |
| Call this function after you adjust the scroll view's bounds if you want it to maintain the current scrolled position More...
|
|
void | OnScrollBar () |
| Triggered by the scroll bars when they change. More...
|
|
virtual void | MoveRelative (Vector3 relative) |
| Move the scroll view by the specified local space amount. More...
|
|
void | MoveAbsolute (Vector3 absolute) |
| Move the scroll view by the specified world space amount. More...
|
|
void | Press (bool pressed) |
| Create a plane on which we will be performing the dragging. More...
|
|
void | Drag () |
| Drag the object along the plane. More...
|
|
void | Scroll (float delta) |
| If the object should support the scroll wheel, do it. More...
|
|
|
virtual void | Start () |
| Set the initial drag value and register the listener delegates. More...
|
|
void | UpdateScrollbars (UIProgressBar slider, float contentMin, float contentMax, float contentSize, float viewSize, bool inverted) |
| Helper function used in UpdateScrollbars(float) function above. More...
|
|
This script, when attached to a panel turns it into a scroll view. You can then attach UIDragScrollView to colliders within to make it draggable.
Enumerator |
---|
None |
|
Momentum |
|
MomentumAndSpring |
|
Enumerator |
---|
Horizontal |
|
Vertical |
|
Unrestricted |
|
Custom |
|
Enumerator |
---|
Always |
|
OnlyIfNeeded |
|
WhenDragging |
|
void UIScrollView.DisableSpring |
( |
| ) |
|
Disable the spring movement.
void UIScrollView.Drag |
( |
| ) |
|
Drag the object along the plane.
void UIScrollView.InvalidateBounds |
( |
| ) |
|
Manually invalidate the scroll view's bounds so that they update next time.
void UIScrollView.MoveAbsolute |
( |
Vector3 |
absolute | ) |
|
Move the scroll view by the specified world space amount.
virtual void UIScrollView.MoveRelative |
( |
Vector3 |
relative | ) |
|
|
virtual |
Move the scroll view by the specified local space amount.
delegate void UIScrollView.OnDragNotification |
( |
| ) |
|
void UIScrollView.OnScrollBar |
( |
| ) |
|
Triggered by the scroll bars when they change.
void UIScrollView.Press |
( |
bool |
pressed | ) |
|
Create a plane on which we will be performing the dragging.
void UIScrollView.ResetPosition |
( |
| ) |
|
Reset the scroll view's position to the top-left corner. It's recommended to call this function before AND after you re-populate the scroll view's contents (ex: switching window tabs). Another option is to populate the scroll view's contents, reset its position, then call this function to reposition the clipping.
bool UIScrollView.RestrictWithinBounds |
( |
bool |
instant | ) |
|
Restrict the scroll view's contents to be within the scroll view's bounds.
bool UIScrollView.RestrictWithinBounds |
( |
bool |
instant, |
|
|
bool |
horizontal, |
|
|
bool |
vertical |
|
) |
| |
Restrict the scroll view's contents to be within the scroll view's bounds.
void UIScrollView.Scroll |
( |
float |
delta | ) |
|
If the object should support the scroll wheel, do it.
virtual void UIScrollView.SetDragAmount |
( |
float |
x, |
|
|
float |
y, |
|
|
bool |
updateScrollbars |
|
) |
| |
|
virtual |
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.
virtual void UIScrollView.Start |
( |
| ) |
|
|
protectedvirtual |
Set the initial drag value and register the listener delegates.
void UIScrollView.UpdatePosition |
( |
| ) |
|
Call this function after you adjust the scroll view's bounds if you want it to maintain the current scrolled position
void UIScrollView.UpdateScrollbars |
( |
| ) |
|
Update the values of the associated scroll bars.
virtual void UIScrollView.UpdateScrollbars |
( |
bool |
recalculateBounds | ) |
|
|
virtual |
Update the values of the associated scroll bars.
void UIScrollView.UpdateScrollbars |
( |
UIProgressBar |
slider, |
|
|
float |
contentMin, |
|
|
float |
contentMax, |
|
|
float |
contentSize, |
|
|
float |
viewSize, |
|
|
bool |
inverted |
|
) |
| |
|
protected |
Helper function used in UpdateScrollbars(float) function above.
Content's pivot point – where it originates from by default.
Vector2 UIScrollView.customMovement = new Vector2(1f, 0f) |
Custom movement, if the 'movement' field is set to 'Custom'.
bool UIScrollView.disableDragIfFits = false |
Whether dragging will be disabled if the contents fit.
DragEffect UIScrollView.dragEffect = DragEffect.MomentumAndSpring |
Effect to apply when dragging.
Horizontal scrollbar used for visualization.
bool UIScrollView.iOSDragEmulation = true |
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.
Bounds UIScrollView.mBounds |
|
protected |
bool UIScrollView.mCalculatedBounds = false |
|
protected |
int UIScrollView.mDragID = -10 |
|
protected |
bool UIScrollView.mDragStarted = false |
|
protected |
Vector2 UIScrollView.mDragStartOffset = Vector2.zero |
|
protected |
bool UIScrollView.mIgnoreCallbacks = false |
|
protected |
Vector3 UIScrollView.mLastPos |
|
protected |
Vector3 UIScrollView.mMomentum = Vector3.zero |
|
protected |
float UIScrollView.momentumAmount = 35f |
How much momentum gets applied when the press is released after dragging.
Movement UIScrollView.movement = Movement.Horizontal |
Type of movement allowed by the scroll view.
Plane UIScrollView.mPlane |
|
protected |
bool UIScrollView.mPressed = false |
|
protected |
float UIScrollView.mScroll = 0f |
|
protected |
bool UIScrollView.mShouldMove = false |
|
protected |
Transform UIScrollView.mTrans |
|
protected |
Event callback to trigger when the drag process finished. Can be used for additional effects, such as centering on some object.
Event callback to trigger when the drag process begins.
Event callback triggered when the scroll view is moving as a result of momentum in between of OnDragFinished and OnStoppedMoving.
Event callback to trigger when the scroll view's movement ends.
bool UIScrollView.restrictWithinPanel = true |
Whether the dragging will be restricted to be within the scroll view's bounds.
float UIScrollView.scrollWheelFactor = 0.25f |
Effect the scroll wheel will have on the momentum.
ShowCondition UIScrollView.showScrollBars = ShowCondition.OnlyIfNeeded |
Condition that must be met for the scroll bars to become visible.
bool UIScrollView.smoothDragStart = true |
Whether the drag operation will be started smoothly, or if if it will be precise (but will have a noticeable "jump").
Vertical scrollbar used for visualization.
virtual Bounds UIScrollView.bounds |
|
get |
Calculate the bounds used by the widgets.
bool UIScrollView.canMoveHorizontally |
|
get |
Whether the scroll view can move horizontally.
bool UIScrollView.canMoveVertically |
|
get |
Whether the scroll view can move vertically.
Vector3 UIScrollView.currentMomentum |
|
getset |
Current momentum, exposed just in case it's needed.
bool UIScrollView.isDragging |
|
get |
Whether the scroll view is being dragged.
Panel that's being dragged.
virtual bool UIScrollView.shouldMove |
|
getprotected |
Whether the contents of the scroll view should actually be draggable depends on whether they currently fit or not.
virtual bool UIScrollView.shouldMoveHorizontally |
|
get |
Whether the scroll view should be able to move horizontally (contents don't fit).
virtual bool UIScrollView.shouldMoveVertically |
|
get |
Whether the scroll view should be able to move vertically (contents don't fit).
The documentation for this class was generated from the following file: