Catlike Coding
Unity Code Documentation
Public Member Functions | Public Attributes | Protected Member Functions | Properties | List of all members
CatlikeCoding.Clipping.ClipBoxScrollbar Class Reference

Scrollbar for ClipBox component, also a Clipped Element. More...

Inherits CatlikeCoding.Clipping.ClippedElement.

Public Member Functions

void BeginDrag (Vector2 pointInLocalSpace)
 Begin a drag operation. More...
 
void EndDrag ()
 End the current drag operation. More...
 
void UpdateDrag (Vector2 pointInLocalSpace)
 Update the current drag operation. More...
 
- Public Member Functions inherited from CatlikeCoding.Clipping.ClippedElement
void InitializeClipHierarchy ()
 Initialize the clip hierarchy. This method is already called at the appropriate places, you typically should have no reason to call it yourself. More...
 
void UpdateClipHierarchy ()
 Update the clip hierarchy if this element's parent changed. Call this method after changing the transform parent of this element, if it was or is now part of a clip hierarchy. More...
 
void UpdateHierarchyBounds ()
 Update the bounds of the entire clip hierarchy that this element is a part of. More...
 

Public Attributes

float minScrollerLength
 Minimum length of the scroller. More...
 
ScrollbarOrientation orientation
 Orientation of the scrollbar, either horizontal or vertical. More...
 
ClippedSlicedSprite scroller
 Clipped sliced sprite used to represent the scroller. Assumed to be a chil dof the scrollbar. More...
 
float thickness
 Thickness of the scrollbar. More...
 
ClippedSlicedSprite track
 Clipped sliced sprite used to represent the track. Assumed to be a child of the scrollbar. More...
 
- Public Attributes inherited from CatlikeCoding.Clipping.ClippedElement
bool clipsChildren
 Whether the element uses its content bounds to clip its children. More...
 
bool notifiesParent = true
 Whether the element notifies its parent when its bounds have changed. More...
 

Protected Member Functions

override void OnDestroy ()
 Called by Unity when the component is destroyed. More...
 
override void OnEnable ()
 Called by Unity when the component is enabled. More...
 
- Protected Member Functions inherited from CatlikeCoding.Clipping.ClippedElement
virtual void OnClipBoundsChanged ()
 Called when the clip bounds have changed, because the hierarchy bounds have changed. More...
 
virtual void OnContentBoundsChanged ()
 Called when the content bounds have changed, by setting ContentBounds. More...
 

Properties

ClipBox ClipBox [get, set]
 Clip box that this scrollbar connects with. More...
 
- Properties inherited from CatlikeCoding.Clipping.ClippedElement
Bounds2D ClipBounds [get]
 Get the clip bounds. More...
 
Bounds2D ContentBounds [get, set]
 Get or set the content bounds. More...
 
Bounds2D ContentBoundsForParent [get]
 Get the content bounds for use by the element's direct parent. More...
 

Additional Inherited Members

- Protected Attributes inherited from CatlikeCoding.Clipping.ClippedElement
Bounds2D clipBounds
 Clip bounds. More...
 
List< ClippedElementclipChildren
 Clip children. More...
 
ClippedElement clipParent
 Clip parent. More...
 
Bounds2D contentBounds
 Content bounds. More...
 

Detailed Description

Scrollbar for ClipBox component, also a Clipped Element.

The scrollbar is assumed to be a sibling of the clip box. It shapes and positions itself as if in the same local space as the clip box.

The scrollbar has methods that support dragging, but does not itself listen to user input. Use a Scrollbar3DInput or custom solution for that.

Dragging the scroller will do just that. When starting a drag on the track but not on the scroller, the scroller will center on the input.

Member Function Documentation

void CatlikeCoding.Clipping.ClipBoxScrollbar.BeginDrag ( Vector2  pointInLocalSpace)

Begin a drag operation.

While dragging, the scrollbar and clip box will try to follow the input.

Parameters
pointInLocalSpacePoint in the scrollbar's local space.
void CatlikeCoding.Clipping.ClipBoxScrollbar.EndDrag ( )

End the current drag operation.

This will call ActivateRebound on the clip box.

override void CatlikeCoding.Clipping.ClipBoxScrollbar.OnDestroy ( )
protectedvirtual

Called by Unity when the component is destroyed.

Subclasses with their own OnDestroy functionality should override this method and call this base version. It ensures that the clip hierarchy stays valid.

Reimplemented from CatlikeCoding.Clipping.ClippedElement.

override void CatlikeCoding.Clipping.ClipBoxScrollbar.OnEnable ( )
protectedvirtual

Called by Unity when the component is enabled.

Subclasses with their own OnEnable functionality should override this method and call this base version. It ensures that clip hierarchy gets initialized.

Reimplemented from CatlikeCoding.Clipping.ClippedElement.

void CatlikeCoding.Clipping.ClipBoxScrollbar.UpdateDrag ( Vector2  pointInLocalSpace)

Update the current drag operation.

Parameters
pointInLocalSpacePoint in the scrollbar's local space.

Member Data Documentation

float CatlikeCoding.Clipping.ClipBoxScrollbar.minScrollerLength

Minimum length of the scroller.

Use this to make sure that the scroller doesn't become too small.

ScrollbarOrientation CatlikeCoding.Clipping.ClipBoxScrollbar.orientation

Orientation of the scrollbar, either horizontal or vertical.

ClippedSlicedSprite CatlikeCoding.Clipping.ClipBoxScrollbar.scroller

Clipped sliced sprite used to represent the scroller. Assumed to be a chil dof the scrollbar.

float CatlikeCoding.Clipping.ClipBoxScrollbar.thickness

Thickness of the scrollbar.

ClippedSlicedSprite CatlikeCoding.Clipping.ClipBoxScrollbar.track

Clipped sliced sprite used to represent the track. Assumed to be a child of the scrollbar.

Property Documentation

ClipBox CatlikeCoding.Clipping.ClipBoxScrollbar.ClipBox
getset

Clip box that this scrollbar connects with.

Note that there is no limit to how many scrollbars are connected with a clip box.