aboutsummaryrefslogtreecommitdiffstats
path: root/Lua/src/lua/ULuaUtils.pas
diff options
context:
space:
mode:
authorwhiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c>2009-07-14 19:08:03 +0000
committerwhiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c>2009-07-14 19:08:03 +0000
commit71c0f51aa0d9d01b22e3da401bccfe88c41399f2 (patch)
treed883e36e46483467c9657821791d7ad24022514c /Lua/src/lua/ULuaUtils.pas
parente86e99462f608406da825043acde9c7b8147b907 (diff)
downloadusdx-71c0f51aa0d9d01b22e3da401bccfe88c41399f2.tar.gz
usdx-71c0f51aa0d9d01b22e3da401bccfe88c41399f2.tar.xz
usdx-71c0f51aa0d9d01b22e3da401bccfe88c41399f2.zip
4 new lua interface function for module ScreenSing
new procedure in ULuaUtils lua_PushRect git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/experimental@1846 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'Lua/src/lua/ULuaUtils.pas')
-rw-r--r--Lua/src/lua/ULuaUtils.pas33
1 files changed, 33 insertions, 0 deletions
diff --git a/Lua/src/lua/ULuaUtils.pas b/Lua/src/lua/ULuaUtils.pas
index 4ac1d80a..143b34d4 100644
--- a/Lua/src/lua/ULuaUtils.pas
+++ b/Lua/src/lua/ULuaUtils.pas
@@ -49,6 +49,13 @@ function Lua_ToBinInt(L: PLua_State; idx: Integer): Integer;
and pushed the table onto the stack }
procedure Lua_PushBinInt(L: PLua_State; BinInt: Integer);
+{ pushes a table with position and size of a rectangle
+ t.x => position of the rectangle in pixels at x-axis
+ t.y => position of the rectangle in pixels at y-axis
+ t.w => width of the rectangle
+ t.h => height of the rectangle }
+procedure Lua_PushRect(L: PLua_State; X, Y, W, H: Double);
+
{ returns plugin that is the owner of the given state
may raise a lua error if the parent id is not found
in states registry, if state owner does not exists
@@ -119,6 +126,32 @@ begin
end;
end;
+{ pushes a table with position and size of a rectangle
+ t.x => position of the rectangle in pixels at x-axis
+ t.y => position of the rectangle in pixels at y-axis
+ t.w => width of the rectangle
+ t.h => height of the rectangle }
+procedure Lua_PushRect(L: PLua_State; X, Y, W, H: Double);
+begin
+ lua_createtable(L, 0, 4); // table w/ 4 record fields
+
+ // x pos
+ lua_pushNumber(L, X);
+ lua_setField(L, -2, 'x');
+
+ // y pos
+ lua_pushNumber(L, Y);
+ lua_setField(L, -2, 'y');
+
+ // width
+ lua_pushNumber(L, W);
+ lua_setField(L, -2, 'w');
+
+ // height
+ lua_pushNumber(L, H);
+ lua_setField(L, -2, 'h');
+end;
+
{ returns plugin that is the owner of the given state
may raise a lua error if the parent id is not found
in states registry, if state owner does not exists