X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fgraphics%2FFont.h;fp=src%2Fgraphics%2FFont.h;h=0294d2539f0c47417ad45083d7a273b919eff4bb;hb=ca31ddeab37eebaa2de5e5b1c94974fac06d418b;hp=0000000000000000000000000000000000000000;hpb=2efa2ecd04a9c38d31e91950eac098faa3e5ca08;p=l2e.git diff --git a/src/graphics/Font.h b/src/graphics/Font.h new file mode 100644 index 0000000..0294d25 --- /dev/null +++ b/src/graphics/Font.h @@ -0,0 +1,38 @@ +/* + * Font.h + * + * Created on: Aug 8, 2012 + * Author: holy + */ + +#ifndef GRAPHICS_FONT_H_ +#define GRAPHICS_FONT_H_ + +#include "Sprite.h" +#include "../geometry/Point.h" + +#include + +namespace graphics { + +class Font { + +public: + explicit Font(const Sprite *sprite, int digitsCol = 0, int digitsRow = 0) : sprite(sprite), digitsCol(digitsCol), digitsRow(digitsRow) { } + +public: + int CharWidth() const { return sprite->Width(); } + int CharHeight() const { return sprite->Height(); } + void DrawDigit(int digit, SDL_Surface *dest, geometry::Point position) const; + void DrawNumber(int number, SDL_Surface *dest, geometry::Point position, int digits = 0) const; + +private: + const Sprite *sprite; + int digitsCol; + int digitsRow; + +}; + +} + +#endif /* GRAPHICS_FONT_H_ */