]> git.localhorst.tv Git - l2e.git/blobdiff - src/graphics/Font.h
added type description of Font
[l2e.git] / src / graphics / Font.h
index c48ea16a8410269b075fbb801c4d1c17cb921921..8b365252c79fdb966ef1b287850557808d0aad26 100644 (file)
@@ -9,7 +9,7 @@
 #define GRAPHICS_FONT_H_
 
 #include "Sprite.h"
-#include "../geometry/Point.h"
+#include "../geometry/Vector.h"
 
 #include <SDL.h>
 
@@ -18,7 +18,7 @@ namespace graphics {
 class Font {
 
 public:
-       explicit Font(const Sprite *sprite, int colOffset = 0, int rowOffset = 0)
+       explicit Font(const Sprite *sprite = 0, int colOffset = 0, int rowOffset = 0)
        : sprite(sprite), colOffset(colOffset), rowOffset(rowOffset) {
 
        }
@@ -26,10 +26,17 @@ public:
 public:
        int CharWidth() const { return sprite->Width(); }
        int CharHeight() const { return sprite->Height(); }
-       void DrawChar(char c, SDL_Surface *dest, const geometry::Point<int> &position) const;
-       void DrawString(const char *s, SDL_Surface *dest, const geometry::Point<int> &position, int maxChars = 0) const;
-       void DrawDigit(int d, SDL_Surface *dest, const geometry::Point<int> &position) const;
-       void DrawNumber(int n, SDL_Surface *dest, const geometry::Point<int> &position, int digits = 0) const;
+       void DrawChar(char c, SDL_Surface *dest, const geometry::Vector<int> &position) const;
+       void DrawString(const char *s, SDL_Surface *dest, const geometry::Vector<int> &position, int maxChars = 0) const;
+       void DrawDigit(int d, SDL_Surface *dest, const geometry::Vector<int> &position) const;
+       void DrawNumber(int n, SDL_Surface *dest, const geometry::Vector<int> &position, int digits = 0) const;
+
+public:
+       void SetSprite(const Sprite *s) { sprite = s; }
+       void SetColOffset(int n) { colOffset = n; }
+       void SetRowOffset(int n) { rowOffset = n; }
+
+       static void CreateTypeDescription();
 
 private:
        const Sprite *sprite;