Used to draw horizontal bar indicators using characters on a Gameduino display. Requires Gameduino library.
This is used to display moving bar style indicators on a Gameduino VGA display. You will require the Gameduino library in order to use this. The indicators are made up of a horizontal strip of characters. The left side of the indicator represents the minimum possible reading and the right side represents the maximum possible reading. When you draw the indicator you specify what reading to display and the code works out which characters to display so that a bar is drawn starting at the left and extending right up to an appropriate position. The BarIndicator class allows you to specify the location of the indicator on the screen, the length of the indicator (the number of characters to use) and the minimum and maximum values for the bar. You can also change which section of the character set to use when drawing the bar.
Revision 3:6607ad01c5a1, committed 2012-11-11
- Comitter:
- RichardE
- Date:
- Sun Nov 11 17:06:06 2012 +0000
- Parent:
- 2:0ca3285971c6
- Commit message:
- BarIndicator constructor now defaults to using character codes 128 to 137 when drawing indicators.
Changed in this revision
BarIndicator.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 0ca3285971c6 -r 6607ad01c5a1 BarIndicator.cpp --- a/BarIndicator.cpp Sun Nov 11 13:10:59 2012 +0000 +++ b/BarIndicator.cpp Sun Nov 11 17:06:06 2012 +0000 @@ -10,7 +10,7 @@ /** Constructor. */ BarIndicator::BarIndicator() : - startCode( (UInt8)'0' ), + startCode( 128 ), min( (float)0 ), max( (float)100 ), xco( 0 ),