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... | |
![]() | |
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... | |
![]() | |
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 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 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... | |
![]() | |
FilterMode | FilterMode [get, set] |
The filter mode of this dynamic texture. The default filtering is point. More... | |
|
inline |
|
inline |
Draws the left half of a circle to the image.
x0 | The x location in pixels of the middle of the circle. |
y0 | The y location in pixels of the middle of the circle. |
linesGreen | The number of lines out of 5 that should be coloured green, counting up from the right. |
|
inline |
Draws the right half of a circle to the image.
x0 | The x location in pixels of the middle of the circle. |
y0 | The y location in pixels of the middle of the circle. |
linesGreen | The number of lines out of 5 that should be coloured green, counting up from the right. |
|
inlinevirtual |
Writes the pixels out to the screen.
Reimplemented from PowerUI.DynamicTexture.
|
inline |
Increases (or decreases for a negative) the current value of the bar.
delta | A value from 0->1 representing how much the bar should change by. |
|
inline |
Sets the active value of this bar.
power | A value from 0->1 indicating how full the bar is. |
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.