]> code.bitgloo.com Git - clyne/gamedev2.git/commitdiff
Forgot to add Velocity component binding to Lua, added
authorAndy Belle-Isle <drumsetmonkey@gmail.com>
Sat, 31 Aug 2019 20:09:39 +0000 (16:09 -0400)
committerAndy Belle-Isle <drumsetmonkey@gmail.com>
Sat, 31 Aug 2019 20:09:39 +0000 (16:09 -0400)
src/script.cpp

index d471d650825e5cd5f94629d8b9b228603682f7d4..ec8251386231d889ac0c6f8e5311715746f09f73 100644 (file)
@@ -101,6 +101,11 @@ void ScriptSystem::scriptExport()
             "visible", &Render::visible,
             "texture", &Render::texture);
 
+    lua.new_usertype<Velocity>("Velocity",
+            sol::constructors<Velocity(float, float), Velocity()>(),
+            "x", &Velocity::x,
+            "y", &Velocity::y);
+
     auto gamespace = lua["game"].get_or_create<sol::table>();
     gamespace.set_function("spawn", func);
 }