summaryrefslogtreecommitdiff
path: root/Runtime/Lua/LuaHelper.cpp
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2021-10-18 19:56:41 +0800
committerchai <chaifix@163.com>2021-10-18 19:56:41 +0800
commit45328cbadd8a946c19a77301f218efbf650e2f28 (patch)
tree8ec4f3a9737b2cbb9744f8347a56783743be2a4c /Runtime/Lua/LuaHelper.cpp
parentb5702ece4c2cf751c252e76fb885a7ec41ccabe8 (diff)
*misc
Diffstat (limited to 'Runtime/Lua/LuaHelper.cpp')
-rw-r--r--Runtime/Lua/LuaHelper.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/Runtime/Lua/LuaHelper.cpp b/Runtime/Lua/LuaHelper.cpp
new file mode 100644
index 0000000..289f0f6
--- /dev/null
+++ b/Runtime/Lua/LuaHelper.cpp
@@ -0,0 +1,23 @@
+#include "LuaHelper.h"
+
+using namespace LuaBind;
+
+template <>
+Rectf State::GetValue < Rectf >(int idx, const Rectf value)
+{
+ Rectf rect;
+ rect.x = GetField<float>(idx, 1, 0);
+ rect.y = GetField<float>(idx, 2, 0);
+ rect.width = GetField<float>(idx, 3, 0);
+ rect.height = GetField<float>(idx, 4, 0);
+ return rect;
+}
+
+template <>
+Vector2f State::GetValue < Vector2f >(int idx, const Vector2f value)
+{
+ Vector2f v2;
+ v2.x = GetField<float>(idx, 1, 0);
+ v2.y = GetField<float>(idx, 2, 0);
+ return v2;
+}