From c38d5eca7091fc7f0206ed0c746622022b2ae508 Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Mon, 10 Sep 2018 23:11:08 -0400 Subject: Added documentation Also added treeview guielemnt Also added ifilesystem guielement Also added io library --- src/client/lua_api/gui/iguielement.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/client/lua_api/gui/iguielement.cpp') diff --git a/src/client/lua_api/gui/iguielement.cpp b/src/client/lua_api/gui/iguielement.cpp index 7132441..3567d80 100644 --- a/src/client/lua_api/gui/iguielement.cpp +++ b/src/client/lua_api/gui/iguielement.cpp @@ -21,7 +21,7 @@ using namespace gui; /*** Move a window (by an offset) @function guielement:move() -@tparam vec2 position The offset to move this element by +@tparam vector2d position The offset to move this element by */ //move({element},{x,y}) -> nil int moveiguielement(lua_State* L){ @@ -83,6 +83,18 @@ int setiguitext(lua_State* L){ return 0; } +//setRect({guielement},{{sx,sy},{ex,ey}}) :: nil +int setrelrect(lua_State *L){ + long sx,sy,ex,ey; + poprecti(L,&sx,&sy,&ex,&ey); + printf("Seting rect %ld %ld %ld %ld\n",sx,sy,ex,ey); + lua_getfield(L,-1,"guielement");//{guielement},ud_element + IGUIElement *el = (IGUIElement*)lua_touserdata(L,-1); + lua_pop(L,2); + el->setRelativePosition(rect(sx,sy,ex,ey)); + return 0; +} + /*** @function guielement:gettext() -- cgit v1.2.3-70-g09d2