#include "Font.h"
+#include "../loader/TypeDescription.h"
+
#include <cmath>
#include <iostream>
using geometry::Vector;
+using loader::FieldDescription;
+using loader::TypeDescription;
using std::pow;
namespace graphics {
}
}
+
+void Font::CreateTypeDescription() {
+ Font f;
+ TypeDescription &td(TypeDescription::CreateOrGet("Font"));
+
+ td.SetSize(sizeof(Font));
+
+ int numberId(TypeDescription::GetTypeId("Number"));
+ int spriteId(TypeDescription::GetTypeId("Sprite"));
+
+ td.AddField("sprite", FieldDescription(((char *)&f.sprite) - ((char *)&f), spriteId, true));
+ td.AddField("columnoffset", FieldDescription(((char *)&f.colOffset) - ((char *)&f), numberId, false));
+ td.AddField("rowoffset", FieldDescription(((char *)&f.rowOffset) - ((char *)&f), numberId, false));
+}
+
}
void SetColOffset(int n) { colOffset = n; }
void SetRowOffset(int n) { rowOffset = n; }
+ static void CreateTypeDescription();
+
private:
const Sprite *sprite;
int colOffset;