VERSIÓ 1.3.12
- [FIX] La paleta per defecte era tota transparent - [NEW] draw.rrect() i draw.rrectf()
This commit is contained in:
24
lua.cpp
24
lua.cpp
@@ -429,6 +429,28 @@ extern "C" {
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int cpp_draw_roundrect(lua_State *L) {
|
||||
int x = luaL_checknumber(L, 1);
|
||||
int y = luaL_checknumber(L, 2);
|
||||
int w = luaL_checknumber(L, 3);
|
||||
int h = luaL_checknumber(L, 4);
|
||||
int r = luaL_optnumber(L, 5, 4);
|
||||
uint8_t color = luaL_checkinteger(L, 6);
|
||||
roundrect(x, y, w, h, r, color);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int cpp_draw_roundrectfill(lua_State *L) {
|
||||
int x = luaL_checknumber(L, 1);
|
||||
int y = luaL_checknumber(L, 2);
|
||||
int w = luaL_checknumber(L, 3);
|
||||
int h = luaL_checknumber(L, 4);
|
||||
int r = luaL_optnumber(L, 5, 4);
|
||||
uint8_t color = luaL_checkinteger(L, 6);
|
||||
roundrectfill(x, y, w, h, r, color);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int cpp_draw_oval(lua_State *L) {
|
||||
int x0 = luaL_checknumber(L, 1);
|
||||
int y0 = luaL_checknumber(L, 2);
|
||||
@@ -924,6 +946,8 @@ void push_lua_funcs() {
|
||||
lua_pushcfunction(L,cpp_draw_rectfill); lua_setfield(L, -2, "rectf");
|
||||
lua_pushcfunction(L,cpp_draw_circ); lua_setfield(L, -2, "circ");
|
||||
lua_pushcfunction(L,cpp_draw_circfill); lua_setfield(L, -2, "circf");
|
||||
lua_pushcfunction(L,cpp_draw_roundrect); lua_setfield(L, -2, "rrect");
|
||||
lua_pushcfunction(L,cpp_draw_roundrectfill); lua_setfield(L, -2, "rrectf");
|
||||
lua_pushcfunction(L,cpp_draw_oval); lua_setfield(L, -2, "oval");
|
||||
lua_pushcfunction(L,cpp_draw_ovalfill); lua_setfield(L, -2, "ovalf");
|
||||
lua_pushcfunction(L,cpp_draw_pattern); lua_setfield(L, -2, "pattern");
|
||||
|
||||
Reference in New Issue
Block a user