#include "Game.h"
#include "fns.h"
#include <GL/gl.h>
+#include <stdexcept>
+#include <map>
+#include <fstream>
+#include <yaml-cpp/yaml.h>
using namespace std;
-Text::Text(string id, FontType t, int s, SDL_Color c, int w, int h)
+Text::Text(string filename, string id, FontType t, int s, SDL_Color c,
+ int w, int h)
: WorldObject(id),
mFont(Game::game()->getFont(s, t)),
color(c),
width(w),
height(h)
{
-
+ ifstream ifs(filename.c_str());
+ YAML::Parser parser(ifs);
+ YAML::Node byLanguage;
+ parser.GetNextDocument(byLanguage);
+
+ /** \todo un-hard-code this language */
+ const YAML::Node& byId = byLanguage["en"];
+ byId[id] >> text;
}
Text::Text(string name, string t, int s, SDL_Color c, int w, int h)
width(w),
height(h)
{
-
+ throw new runtime_error("I haven't implemented this yet.");
}
Text::~Text()
int width;
int height;
Text(string name, string 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(string filename, string id, FontType t, int size = 24, SDL_Color c = WHITE, int w = 600, int h = 150);
~Text();
};
#endif