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

Extended progress bar that has backwards compatibility logic and adds interaction support. More...

Inheritance diagram for UISlider:
UIProgressBar UIWidgetContainer UIScrollBar

Protected Member Functions

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...
 
virtual float LocalToValue (Vector2 localPos)
 Calculate the value of the progress bar given the specified local position. More...
 
void SetThumbPosition (Vector3 worldPos)
 Set the position of the thumb to the specified world coordinates. More...
 

Protected Attributes

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 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 Member Functions inherited from UIProgressBar
delegate void OnDragFinished ()
 
virtual void ForceUpdate ()
 Update the value of the scroll bar. More...
 
- 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

Extended progress bar that has backwards compatibility logic and adds interaction support.

Member Function Documentation

void UISlider.OnDragBackground ( GameObject  go,
Vector2  delta 
)
protected

Position the scroll bar to be under the current touch.

void UISlider.OnDragForeground ( GameObject  go,
Vector2  delta 
)
protected

Drag the scroll bar in the specified direction.

void UISlider.OnKey ( KeyCode  key)
protected

Watch for key events and adjust the value accordingly.

void UISlider.OnPressBackground ( GameObject  go,
bool  isPressed 
)
protected

Position the scroll bar to be under the current touch.

void UISlider.OnPressForeground ( GameObject  go,
bool  isPressed 
)
protected

Save the position of the foreground on press.

override void UISlider.OnStart ( )
protectedvirtual

Register an event listener.

Reimplemented from UIProgressBar.

override void UISlider.Upgrade ( )
protectedvirtual

Upgrade from legacy functionality.

Reimplemented from UIProgressBar.

Member Data Documentation

bool UISlider.mInverted = false
protected

Property Documentation

bool UISlider.inverted
getset
float UISlider.sliderValue
getset

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