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

Simple progress bar that fills itself based on the specified value. More...

Inheritance diagram for UIProgressBar:
UIWidgetContainer UISlider UIScrollBar

Public Types

enum  FillDirection { FillDirection.LeftToRight, FillDirection.RightToLeft, FillDirection.BottomToTop, FillDirection.TopToBottom }
 

Public Member Functions

delegate void OnDragFinished ()
 
virtual void ForceUpdate ()
 Update the value of the scroll bar. More...
 

Public Attributes

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

static UIProgressBar current
 Current slider. This value is set prior to the callback function being triggered. More...
 

Protected Member Functions

void Start ()
 Register the event listeners. More...
 
virtual void Upgrade ()
 Used to upgrade from legacy functionality. More...
 
virtual void OnStart ()
 Functionality for derived classes. 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

UIWidget mBG
 
UIWidget mFG
 
float mValue = 1f
 
FillDirection mFill = FillDirection.LeftToRight
 
Transform mTrans
 
bool mIsDirty = false
 
Camera mCam
 
float mOffset = 0f
 

Properties

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...
 

Detailed Description

Simple progress bar that fills itself based on the specified value.

Member Enumeration Documentation

Enumerator
LeftToRight 
RightToLeft 
BottomToTop 
TopToBottom 

Member Function Documentation

virtual void UIProgressBar.ForceUpdate ( )
virtual

Update the value of the scroll bar.

Reimplemented in UIScrollBar.

virtual float UIProgressBar.LocalToValue ( Vector2  localPos)
protectedvirtual

Calculate the value of the progress bar given the specified local position.

Reimplemented in UIScrollBar.

delegate void UIProgressBar.OnDragFinished ( )
virtual void UIProgressBar.OnStart ( )
protectedvirtual

Functionality for derived classes.

Reimplemented in UIScrollBar, and UISlider.

void UIProgressBar.OnValidate ( )
protected

Invalidate the scroll bar.

float UIProgressBar.ScreenToValue ( Vector2  screenPos)
protected

Drag the scroll bar by the specified on-screen amount.

void UIProgressBar.SetThumbPosition ( Vector3  worldPos)
protected

Set the position of the thumb to the specified world coordinates.

void UIProgressBar.Start ( )
protected

Register the event listeners.

void UIProgressBar.Update ( )
protected

Update the value of the scroll bar if necessary.

virtual void UIProgressBar.Upgrade ( )
protectedvirtual

Used to upgrade from legacy functionality.

Reimplemented in UIScrollBar, and UISlider.

Member Data Documentation

UIProgressBar UIProgressBar.current
static

Current slider. This value is set prior to the callback function being triggered.

UIWidget UIProgressBar.mBG
protected
Camera UIProgressBar.mCam
protected
UIWidget UIProgressBar.mFG
protected
FillDirection UIProgressBar.mFill = FillDirection.LeftToRight
protected
bool UIProgressBar.mIsDirty = false
protected
float UIProgressBar.mOffset = 0f
protected
Transform UIProgressBar.mTrans
protected
float UIProgressBar.mValue = 1f
protected
int UIProgressBar.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.

List<EventDelegate> UIProgressBar.onChange = new List<EventDelegate>()

Callbacks triggered when the scroll bar's value changes.

OnDragFinished UIProgressBar.onDragFinished

Delegate triggered when the scroll bar stops being dragged. Useful for things like centering on the closest valid object, for example.

Transform UIProgressBar.thumb

Object that acts as a thumb.

Property Documentation

float UIProgressBar.alpha
getset

Allows to easily change the scroll bar's alpha, affecting both the foreground and the background sprite at once.

UIWidget UIProgressBar.backgroundWidget
getset

Widget used for the background.

Camera UIProgressBar.cachedCamera
get

Camera used to draw the scroll bar.

Transform UIProgressBar.cachedTransform
get

Cached for speed.

FillDirection UIProgressBar.fillDirection
getset

The scroll bar's direction.

UIWidget UIProgressBar.foregroundWidget
getset

Widget used for the foreground.

bool UIProgressBar.isHorizontal
getprotected

Whether the progress bar is horizontal in nature. Convenience function.

bool UIProgressBar.isInverted
getprotected

Whether the progress bar is inverted in its behaviour. Convenience function.

float UIProgressBar.value
getset

Modifiable value for the scroll bar, 0-1 range.


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