gui: more lua support + 'coord' renamed to 'pos'
This commit is contained in:
@@ -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_
|
||||
|
||||
Reference in New Issue
Block a user