- Main Page
- Classes
- Files

- File List

# C:/Documents and Settings/Administrator/Desktop/woopsi-src-0.39/Woopsi/woopsi/fontbase.h

    00001 #ifndef _FONT_BASE_H_
    00002 #define _FONT_BASE_H_
    00003
    00004 #include <nds.h>
    00005 #include <string.h>
    00006
    00007 #define GLYPH_MAP_SIZE 32
    00008
    00009 namespace WoopsiUI {
    00010
    00016         class FontBase {
    00017
    00018         public:
    00019
    00026                 FontBase(const u8 height, const u16 transparentColour = 0) {
    00027                         _height = height;
    00028                         _drawColour = 0;
    00029                         _isMonochrome = false;
    00030                 }
    00031
    00035                 virtual inline ~FontBase() { };
    00036
    00043                 virtual const bool isCharBlank(const char letter) const = 0;
    00044
    00050                 void setColour(const u16 colour) {
    00051                         _drawColour = colour;
    00052                         _isMonochrome = true;
    00053                 }
    00054
    00061                 inline const u16 getColour() const { return _drawColour; };
    00062
    00067                 inline const bool isMonochrome() const { return _isMonochrome; };
    00068
    00073                 inline const u16 getTransparentColour() const { return _transparentColour; };
    00074
    00079                 inline void setTransparentColour(const u16 colour) { _transparentColour = colour; };
    00080
    00085                 inline void clearColour() {
    00086                         _isMonochrome = false;
    00087                         _drawColour = 0;
    00088                 };
    00089
    00104                 virtual s16 drawChar(u16* bitmap, u16 bitmapWidth, u16 bitmapHeight, char letter, s16 x, s16 y, u16 clipX1, u16 clipY1, u16 clipX2, u16 clipY2) = 0;
    00105
    00111                 virtual u16 getStringWidth(const char* text) const = 0;
    00112
    00121                 virtual u16 getStringWidth(const char* text, u16 length) const = 0;
    00122
    00128                 virtual u16 getCharWidth(char letter) const = 0;
    00129
    00134                 inline const u8 getHeight() const { return _height; };
    00135
    00136         private:
    00137                 u8 _height;
    00138                 u16 _drawColour;
    00139                 bool _isMonochrome;
    00140                 u16 _transparentColour;
    00141         };
    00142 }
    00143
    00144 #endif

All Classes Functions Variables Enumerations Enumerator