- [NEW] mouse.inside(x,y,w,h)

- [WIP] fonted tool
This commit is contained in:
2025-12-09 14:05:12 +01:00
parent eac20bbbe0
commit 6e15fe7231
6 changed files with 232 additions and 126 deletions

10
lua.cpp
View File

@@ -892,6 +892,15 @@ extern "C" {
return 0;
}
static int cpp_mouse_inside(lua_State *L) {
int x = luaL_checkinteger(L, 1);
int y = luaL_checkinteger(L, 2);
int w = luaL_checkinteger(L, 3);
int h = luaL_checkinteger(L, 4);
lua_pushboolean(L, minside(x,y,w,h));
return 1;
}
// key
// ===============================================
@@ -1072,6 +1081,7 @@ void push_lua_funcs() {
lua_pushcfunction(L,cpp_mouse_press); lua_setfield(L, -2, "press");
lua_pushcfunction(L,cpp_mouse_dblclick); lua_setfield(L, -2, "dblclick");
lua_pushcfunction(L,cpp_mouse_discard); lua_setfield(L, -2, "discard");
lua_pushcfunction(L,cpp_mouse_inside); lua_setfield(L, -2, "inside");
lua_pushinteger(L, 1); lua_setfield(L, -2, "LEFT");
lua_pushinteger(L, 2); lua_setfield(L, -2, "MIDDLE");