00001 /* This Spaceshooter is an small space adventure game 00002 * Copyright (C) 2006,2007 Steffen Nörtershäuser 00003 * Copyright (C) 2008 Christoph Egger 00004 * 00005 * This program is free software: you can redistribute it and/or modify 00006 * it under the terms of the GNU General Public License as published by 00007 * the Free Software Foundation, either version 3 of the License, or 00008 * (at your option) any later version. 00009 * 00010 * This program is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 * GNU General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU General Public License 00016 * along with this program. If not, see <http://www.gnu.org/licenses/>. 00017 */ 00018 00020 //BitmapFont.h - Deklaration der Klasse CBitmapFont 00021 //CBitmapFont wird für das Darstellen BitmapFonts bentötigt 00022 //Steffen Nörtershäuser 00024 00025 #ifndef BITMAPFONT_H 00026 #define BITMAPFONT_H 00027 00029 00030 #include "Globals.hpp" 00031 #include <vector> 00032 #include <string> 00033 #include <SFML/Graphics.hpp> 00034 00036 00040 class CBitmapFont 00041 { 00042 public: 00043 //Konstruktur und Destruktor 00044 CBitmapFont(); 00045 ~CBitmapFont(); 00046 00047 void Init(); 00048 00049 //Zeichnet den angebenen Text 00050 void DrawText(float x, float y, std::string Text, float PixelHeight = 0.0f, float RectXSize = 10000.0f, float RectYSize = 10000.0f, 00051 int ScrollY = 0, bool* CanScroll = NULL, int Alpha = 255, bool CenterdX = false); 00052 00053 //Diese Funktion gibt die Fonthöhe zurück 00054 float GetFontHeight() { return m_FontSprites[0]->GetSubRect().GetHeight(); } 00055 private: 00056 00057 //In diesem Vektor werden die BuchstabenSprites gespeichert 00058 std::vector<sf::Sprite*> m_FontSprites; 00059 00060 //Diese Funktion fügt einen BuchstabenSprite hinzu 00061 void AddChar(std::string FileName); 00062 }; 00063 #endif