#include <GL/gl.h>
using namespace std;
-Text::Text(string filename, FontType t, int s, SDL_Color c, int w, int h ) : WorldObject(filename), mFont(Game::game()->getCurrentLevel()->getFont(s, t)), color(c), width(w), height(h) {
+Text::Text(string id, FontType t, int s, SDL_Color c, int w, int h)
+ : WorldObject(id),
+ mFont(Game::game()->getCurrentLevel()->getFont(s, t)),
+ color(c),
+ width(w),
+ height(h)
+{
}
-Text::Text(string name, string t, int s, SDL_Color c, int w, int h) : WorldObject(name), text(t), mFont(Game::game()->getCurrentLevel()->getFont(s, (FontType)0)), color(c), width(w), height(h) {
+Text::Text(string name, string t, int s, SDL_Color c, int w, int h)
+ : WorldObject(name),
+ text(t),
+ mFont(Game::game()->getCurrentLevel()->getFont(s, (FontType)0)),
+ color(c),
+ width(w),
+ height(h)
+{
}
-Text::~Text() {
+Text::~Text()
+{
Game::game()->getCurrentLevel()->closeFont(mFont);
}
glDeleteTextures(1, &texture);
}
-void Text::update() {
-}
\ No newline at end of file
+void Text::update()
+{
+}
*/
class Text : public WorldObject
{
- public:
+public:
Font* mFont;
string text;
SDL_Color color;
int width;
int height;
Text(string name, string t, int size = 24, SDL_Color c = WHITE, int w = 600, int h = 150);
- Text(string filename, FontType t, int size = 24, SDL_Color c = WHITE, int w = 600, int h = 150);
+ Text(string id, FontType t, int size = 24, SDL_Color c = WHITE, int w = 600, int h = 150);
~Text();
};
#endif