}
}
+void Font::DrawStringRight(const char *s, SDL_Surface *dest, const Vector<int> &positionIn, int maxChars) const {
+ if (!sprite) return;
+
+ int length(0);
+ while (length < maxChars && s[length] != '\0') {
+ ++length;
+ }
+ Vector<int> position(positionIn.X() - length * CharWidth(), positionIn.Y());
+
+ DrawString(s, dest, position, length);
+}
+
void Font::DrawDigit(int digit, SDL_Surface *dest, const Vector<int> &position) const {
if (!sprite) return;
}
}
+void Font::DrawNumberRight(int number, SDL_Surface *dest, const Vector<int> &positionIn, int digits) const {
+ if (!sprite) return;
+
+ Vector<int> position(positionIn.X() - digits * CharWidth(), positionIn.Y());
+
+ DrawNumber(number, dest, position, digits);
+}
+
void Font::CreateTypeDescription() {
Font f;
int CharHeight() const { return sprite->Height(); }
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 DrawStringRight(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;
+ void DrawNumberRight(int n, SDL_Surface *dest, const geometry::Vector<int> &position, int digits = 0) const;
public:
void SetSprite(const Sprite *s) { sprite = s; }