gui: more lua support + 'coord' renamed to 'pos'

This commit is contained in:
MihailRis
2024-02-18 22:08:08 +03:00
parent 6f88502cae
commit ed6a377e90
5 changed files with 23 additions and 11 deletions
+8
View File
@@ -85,6 +85,14 @@ namespace lua {
lua_rawseti(L, -2, 4);
return 1;
}
inline glm::vec2 tovec2(lua_State* L, int idx) {
lua_rawgeti(L, idx, 1);
lua::luanumber x = lua_tonumber(L, -1); lua_pop(L, -1);
lua_rawgeti(L, idx, 1);
lua::luanumber y = lua_tonumber(L, -1); lua_pop(L, -1);
return glm::vec2(x, y);
}
}
#endif // LOGIC_SCRIPTING_LUA_UTIL_H_