Major rewrite of scripting support:
[supertux.git] / src / object / text_object.cpp
index 8081e85..8608b9f 100644 (file)
@@ -5,6 +5,7 @@
 #include <iostream>
 #include "resources.hpp"
 #include "video/drawing_context.hpp"
+#include "scripting/wrapper_util.hpp"
 #include "msg.hpp"
 
 TextObject::TextObject()
@@ -19,6 +20,19 @@ TextObject::~TextObject()
 }
 
 void
+TextObject::expose(HSQUIRRELVM vm, int table_idx)
+{
+  Scripting::Text* interface = static_cast<Scripting::Text*> (this);
+  Scripting::expose_object(vm, table_idx, interface, "Text", false);
+}
+
+void
+TextObject::unexpose(HSQUIRRELVM vm, int table_idx)
+{
+  Scripting::unexpose_object(vm, table_idx, "Text");
+}
+
+void
 TextObject::set_font(const std::string& name)
 {
   if(name == "gold") {
@@ -34,7 +48,7 @@ TextObject::set_font(const std::string& name)
   } else if(name == "small") {
     font = white_small_text;
   } else {
-    msg_warning("Unknown font '" << name << "'.");
+    msg_warning << "Unknown font '" << name << "'." << std::endl;
   }
 }