diff options
author | chai <chaifix@163.com> | 2021-11-20 17:32:55 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-11-20 17:32:55 +0800 |
commit | bb452bba78dc1870d6316b383180472fe3a8a06a (patch) | |
tree | 6084d6c608e00f28fe4b1437e0df228d68c268de /Runtime/Scripting/GUI/GUI.bind.cpp | |
parent | 74ca8143a7c2352425d549b681b2838bda5ee218 (diff) |
*gui
Diffstat (limited to 'Runtime/Scripting/GUI/GUI.bind.cpp')
-rw-r--r-- | Runtime/Scripting/GUI/GUI.bind.cpp | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/Runtime/Scripting/GUI/GUI.bind.cpp b/Runtime/Scripting/GUI/GUI.bind.cpp index e05d373..cc4ef88 100644 --- a/Runtime/Scripting/GUI/GUI.bind.cpp +++ b/Runtime/Scripting/GUI/GUI.bind.cpp @@ -12,6 +12,7 @@ #include "Runtime/Utilities/AutoInvoke.h" #include "Editor/Win/Win.h"
#include "Runtime/GUI/UILine.h"
+#include "Runtime/GUI/UIQuad.h"
using namespace std; using namespace LuaBind; @@ -103,10 +104,26 @@ static int DrawLine(lua_State* L) return 0; } +// GUI.DrawQuad(topleft, size) +static int DrawQuad(lua_State* L) +{ + LUA_BIND_STATE(L); + + Vector2f tl, size; + tl.RestoreFromLuaObject(state, 1); + size.RestoreFromLuaObject(state, 2); + + UIQuad quad = UIQuad(tl.x, tl.x + size.x, tl.y, tl.y + size.y); + quad.Draw(); + + return 0; +} + static luaL_Reg guiFuncs[] = { { "DrawText", DrawText }, - { "DrawLine", DrawLine }, - {0, 0} + { "DrawLine", DrawLine }, + { "DrawQuad", DrawQuad }, + {0, 0} };
int luaopen_GameLab_Engine_GUI(lua_State* L) |