NGUI: Next-Gen UI kit  3.7.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Macros
UIScrollBar Class Reference

Scroll bar functionality. More...

Inheritance diagram for UIScrollBar:
UISlider UIProgressBar UIWidgetContainer

Public Member Functions

override void ForceUpdate ()
 Update the value of the scroll bar. More...
 
- Public Member Functions inherited from UIProgressBar
delegate void OnDragFinished ()
 

Protected Member Functions

override void Upgrade ()
 Upgrade from legacy functionality. More...
 
override void OnStart ()
 Make the scroll bar's foreground react to press events. More...
 
override float LocalToValue (Vector2 localPos)
 Move the scroll bar to be centered on the specified position. More...
 
- Protected Member Functions inherited from UISlider
override void Upgrade ()
 Upgrade from legacy functionality. More...
 
override void OnStart ()
 Register an event listener. More...
 
void OnPressBackground (GameObject go, bool isPressed)
 Position the scroll bar to be under the current touch. More...
 
void OnDragBackground (GameObject go, Vector2 delta)
 Position the scroll bar to be under the current touch. More...
 
void OnPressForeground (GameObject go, bool isPressed)
 Save the position of the foreground on press. More...
 
void OnDragForeground (GameObject go, Vector2 delta)
 Drag the scroll bar in the specified direction. More...
 
void OnKey (KeyCode key)
 Watch for key events and adjust the value accordingly. More...
 
- Protected Member Functions inherited from UIProgressBar
void Start ()
 Register the event listeners. More...
 
void Update ()
 Update the value of the scroll bar if necessary. More...
 
void OnValidate ()
 Invalidate the scroll bar. More...
 
float ScreenToValue (Vector2 screenPos)
 Drag the scroll bar by the specified on-screen amount. More...
 
void SetThumbPosition (Vector3 worldPos)
 Set the position of the thumb to the specified world coordinates. More...
 

Protected Attributes

float mSize = 1f
 
- Protected Attributes inherited from UISlider
bool mInverted = false
 
- Protected Attributes inherited from UIProgressBar
UIWidget mBG
 
UIWidget mFG
 
float mValue = 1f
 
FillDirection mFill = FillDirection.LeftToRight
 
Transform mTrans
 
bool mIsDirty = false
 
Camera mCam
 
float mOffset = 0f
 

Properties

float scrollValue [get, set]
 
float barSize [get, set]
 The size of the foreground bar in percent (0-1 range). More...
 
- Properties inherited from UISlider
float sliderValue [get, set]
 
bool inverted [get, set]
 
- Properties inherited from UIProgressBar
Transform cachedTransform [get]
 Cached for speed. More...
 
Camera cachedCamera [get]
 Camera used to draw the scroll bar. More...
 
UIWidget foregroundWidget [get, set]
 Widget used for the foreground. More...
 
UIWidget backgroundWidget [get, set]
 Widget used for the background. More...
 
FillDirection fillDirection [get, set]
 The scroll bar's direction. More...
 
float value [get, set]
 Modifiable value for the scroll bar, 0-1 range. More...
 
float alpha [get, set]
 Allows to easily change the scroll bar's alpha, affecting both the foreground and the background sprite at once. More...
 
bool isHorizontal [get]
 Whether the progress bar is horizontal in nature. Convenience function. More...
 
bool isInverted [get]
 Whether the progress bar is inverted in its behaviour. Convenience function. More...
 

Additional Inherited Members

- Public Types inherited from UIProgressBar
enum  FillDirection { FillDirection.LeftToRight, FillDirection.RightToLeft, FillDirection.BottomToTop, FillDirection.TopToBottom }
 
- Public Attributes inherited from UIProgressBar
OnDragFinished onDragFinished
 Delegate triggered when the scroll bar stops being dragged. Useful for things like centering on the closest valid object, for example. More...
 
Transform thumb
 Object that acts as a thumb. More...
 
int numberOfSteps = 0
 Number of steps the slider should be divided into. For example 5 means possible values of 0, 0.25, 0.5, 0.75, and 1.0. More...
 
List< EventDelegateonChange = new List<EventDelegate>()
 Callbacks triggered when the scroll bar's value changes. More...
 
- Static Public Attributes inherited from UIProgressBar
static UIProgressBar current
 Current slider. This value is set prior to the callback function being triggered. More...
 

Detailed Description

Scroll bar functionality.

Member Function Documentation

override void UIScrollBar.ForceUpdate ( )
virtual

Update the value of the scroll bar.

Reimplemented from UIProgressBar.

override float UIScrollBar.LocalToValue ( Vector2  localPos)
protectedvirtual

Move the scroll bar to be centered on the specified position.

Reimplemented from UIProgressBar.

override void UIScrollBar.OnStart ( )
protectedvirtual

Make the scroll bar's foreground react to press events.

Reimplemented from UIProgressBar.

override void UIScrollBar.Upgrade ( )
protectedvirtual

Upgrade from legacy functionality.

Reimplemented from UIProgressBar.

Member Data Documentation

float UIScrollBar.mSize = 1f
protected

Property Documentation

float UIScrollBar.barSize
getset

The size of the foreground bar in percent (0-1 range).

float UIScrollBar.scrollValue
getset

The documentation for this class was generated from the following file: