Used to draw horizontal bar indicators using characters on a Gameduino display. Requires Gameduino library.
BarIndicator Class Reference
Used to draw moving bar indicators on a Gameduino display. More...
#include <BarIndicator.h>
Public Member Functions | |
BarIndicator () | |
Constructor. | |
virtual | ~BarIndicator () |
Destructor. | |
void | SetStartCode (UInt8 sc) |
Set character code at which thermometer characters start. | |
void | SetLimits (float min, float max) |
Set minimum and maximum readings. | |
void | SetLocation (UInt8 x, UInt8 y) |
Set location of indicator on screen using character coordinates. | |
void | SetLength (UInt8 len) |
Set length of indicator (in characters). | |
void | Draw (Gameduino *gd, float reading, bool valid) |
Draw bar indicator. |
Detailed Description
Used to draw moving bar indicators on a Gameduino display.
The indicators are constructed using suitably defined characters.
Definition at line 17 of file BarIndicator.h.
Constructor & Destructor Documentation
BarIndicator | ( | ) |
Constructor.
Definition at line 12 of file BarIndicator.cpp.
~BarIndicator | ( | ) | [virtual] |
Destructor.
Definition at line 24 of file BarIndicator.cpp.
Member Function Documentation
void Draw | ( | Gameduino * | gd, |
float | reading, | ||
bool | valid | ||
) |
Draw bar indicator.
Invalid readings are drawn using a greyed out indicator.
- Parameters:
-
gd Pointer to Gameduino to use for drawing. reading Reading to display on indicator. valid True if reading is valid, False if not.
Definition at line 33 of file BarIndicator.cpp.
void SetLength | ( | UInt8 | len ) |
Set length of indicator (in characters).
- Parameters:
-
len Length of indicator.
Definition at line 68 of file BarIndicator.h.
void SetLimits | ( | float | min, |
float | max | ||
) |
Set minimum and maximum readings.
- Parameters:
-
min Smallest reading that can be shown on bar indicator. max Largest reading that can be shown on bar indicator.
Definition at line 51 of file BarIndicator.h.
void SetLocation | ( | UInt8 | x, |
UInt8 | y | ||
) |
Set location of indicator on screen using character coordinates.
- Parameters:
-
x X coordinate for indicator. y Y coordinate for indicator.
Definition at line 60 of file BarIndicator.h.
void SetStartCode | ( | UInt8 | sc ) |
Set character code at which thermometer characters start.
There should be 10 characters defined starting at this code, in this order: 0 : Empty 1 : 1/8 full 2 : 1/4 full 3 : 3/8 full 4 : 1/2 full 5 : 5/8 full 6 : 3/4 full 7 : 7/8 full 8 : Full 9 : Greyed out (used when reading is invalid).
- Parameters:
-
sc Character code at which thermometer characters start.
Definition at line 43 of file BarIndicator.h.
Generated on Mon Jul 18 2022 01:10:04 by 1.7.2