Inheritance diagram for PowerBar:
PowerUI.DynamicTexture

Public Member Functions

 PowerBar ()
 
void IncreasePower (float delta)
 Increases (or decreases for a negative) the current value of the bar. More...
 
void SetPower (float power)
 Sets the active value of this bar. More...
 
override void Flush ()
 Writes the pixels out to the screen. More...
 
void DrawRightHalfCircle (int x0, int y0, int linesGreen)
 Draws the right half of a circle to the image. More...
 
void DrawLeftHalfCircle (int x0, int y0, int linesGreen)
 Draws the left half of a circle to the image. More...
 
- Public Member Functions inherited from PowerUI.DynamicTexture
 DynamicTexture (int width, int height, string name)
 Creates a new dynamic texture of the given dimensions. More...
 
 DynamicTexture ()
 Creates an empty dynamic texture. Note that this is used internally by canvas. If used, you must call Resize to set it up. More...
 
void ResizeX (int width)
 Resize this texture on the X axis. More...
 
void ResizeY (int height)
 Resize this texture on the Y axis. More...
 
void Resize (int width, int height)
 Resize this texture on the X and Y axis. More...
 
void Resize (int width, int height, bool createIfZero)
 Resize this texture on the X and Y axis, optionally only doing so if dimensions aren't zero. More...
 
Texture2D GetTexture ()
 Gets the texture. More...
 
Texture2D GetTextureHolder ()
 Gets the placeholder texture. More...
 
void DrawPixel (int x, int y, Color32 colour)
 Draws a pixel at the given x/y coordinates to the atlas. More...
 
void DrawLine (int x, int y, int x2, int y2, Color32 colour)
 Draws a line on the atlas from one point to another. More...
 
void DrawCircle (int x0, int y0, int radius, Color32 colour)
 Draws a filled circle on the atlas. More...
 
void Clear ()
 Wipes the graphic clean using transparent black. More...
 
void Clear (Color32 clearColour)
 Wipes the graphic clean. More...
 
void SetPixel (int index, Color32 colour)
 Sets a the colour of a particular global pixel on the atlas. More...
 
void Refresh ()
 Called to refresh the texture. More...
 
void FlushDirect ()
 Internally used only. Flushes the pixel array to the texture right now. More...
 

Public Attributes

float Power =0f
 A value from 0->1 that represents how full the bar is. More...
 
int PixelLines =0
 The number of vertical lines drawn to display the bar. More...
 
Color LitColour =Color.blue
 The colour of a full bar. More...
 
Color UnlitColour =Color.black
 The colour of an empty bar. More...
 
int[] HalfCircleY =new int[]{5,4,4,3,1}
 The y pixel coordinates using the array index as x to draw a quarter circle. The values are essentially mirrored over x to produce a half circle for the ends of the bar. More...
 
- Public Attributes inherited from PowerUI.DynamicTexture
int Width
 The width of the dynamic texture. More...
 
int Height
 The height of the dynamic texture. More...
 
string Name
 The name for this texture. More...
 
bool Refreshing
 True if this texture needs a refresh this frame. More...
 
Color32[] Pixels
 The pixels of this texture. More...
 
int ResizedWidth
 The resized height of the texture (internal). Only used if this texture is resized and it gets shrunk. More...
 
int ResizedHeight
 The resized height of the texture (internal). Only used if this texture is resized and it gets shrunk. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from PowerUI.DynamicTexture
static DynamicTexture Get (string byName)
 Gets a dynamic texture by name from the global lookup. More...
 
static void RemoveAll ()
 Removes all dynamic textures. More...
 
static void Update ()
 Redraw requests are buffered and done in one go by this method. More...
 
- Static Public Attributes inherited from PowerUI.DynamicTexture
static bool SomethingToUpdate
 True if at least one dynamic texture must be flushed this frame. More...
 
static Dictionary< string,
DynamicTexture
Instances
 A global lookup of available dynamic textures used for mapping a URL to an object. E.g. background:url("dynamic://healthbar"); More...
 
- Properties inherited from PowerUI.DynamicTexture
FilterMode FilterMode [get, set]
 The filter mode of this dynamic texture. The default filtering is point. More...
 

Constructor & Destructor Documentation

PowerBar.PowerBar ( )
inline

Member Function Documentation

void PowerBar.DrawLeftHalfCircle ( int  x0,
int  y0,
int  linesGreen 
)
inline

Draws the left half of a circle to the image.

Parameters
x0The x location in pixels of the middle of the circle.
y0The y location in pixels of the middle of the circle.
linesGreenThe number of lines out of 5 that should be coloured green, counting up from the right.
void PowerBar.DrawRightHalfCircle ( int  x0,
int  y0,
int  linesGreen 
)
inline

Draws the right half of a circle to the image.

Parameters
x0The x location in pixels of the middle of the circle.
y0The y location in pixels of the middle of the circle.
linesGreenThe number of lines out of 5 that should be coloured green, counting up from the right.
override void PowerBar.Flush ( )
inlinevirtual

Writes the pixels out to the screen.

Reimplemented from PowerUI.DynamicTexture.

void PowerBar.IncreasePower ( float  delta)
inline

Increases (or decreases for a negative) the current value of the bar.

Parameters
deltaA value from 0->1 representing how much the bar should change by.
void PowerBar.SetPower ( float  power)
inline

Sets the active value of this bar.

Parameters
powerA value from 0->1 indicating how full the bar is.

Member Data Documentation

int [] PowerBar.HalfCircleY =new int[]{5,4,4,3,1}

The y pixel coordinates using the array index as x to draw a quarter circle. The values are essentially mirrored over x to produce a half circle for the ends of the bar.

Color PowerBar.LitColour =Color.blue

The colour of a full bar.

int PowerBar.PixelLines =0

The number of vertical lines drawn to display the bar.

float PowerBar.Power =0f

A value from 0->1 that represents how full the bar is.

Color PowerBar.UnlitColour =Color.black

The colour of an empty bar.