- [NEW] mouse.inside(x,y,w,h)
- [WIP] fonted tool
This commit is contained in:
10
lua.cpp
10
lua.cpp
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user