LuaBox
Loading...
Searching...
No Matches
DisplayRect.h
Go to the documentation of this file.
1#pragma once
2
3#include "lua_include.h"
4#include "global.h"
5
24
25int DisplayRect(lua_State* L_)
26{
27 int x1 = luaL_checkinteger(L_, 1);
28 int y1 = luaL_checkinteger(L_, 2);
29 int x2 = luaL_checkinteger(L_, 3);
30 int y2 = luaL_checkinteger(L_, 4);
31 int c = luaL_checkinteger(L_, 5);
32 int r = 0;
33
34 if (lua_gettop(L_) >= 6)
35 r = luaL_checkinteger(L_, 6);
36
37 if (r > 0)
38 sprite.drawRoundRect(x1, y1, x2, y2, r, c);
39 else
40 sprite.drawRect(x1, y1, x2, y2, c);
41
42 return 0;
43}
int DisplayRect(lua_State *L_)
Draws a rectangle (optionally with rounded corners) on the sprite buffer.
Definition DisplayRect.h:25