MCPcopy Create free account
hub / github.com/danomatika/ofxLua / scriptMousePressed

Method scriptMousePressed

src/ofxLua.cpp:355–368  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

353}
354
355void ofxLua::scriptMousePressed(int x, int y, int button) {
356 if(L == NULL || !isFunction("mousePressed")) {
357 return;
358 }
359 lua_getglobal(L, "mousePressed");
360 lua_pushinteger(L, x);
361 lua_pushinteger(L, y);
362 lua_pushinteger(L, button);
363 if(lua_pcall(L, 3, 0, 0) != 0) {
364 std::string msg = "Error running mousePressed(): "
365 + (std::string) lua_tostring(L, LUA_STACK_TOP);
366 errorOccurred(msg);
367 }
368}
369
370void ofxLua::scriptMouseReleased(int x, int y, int button) {
371 if(L == NULL || !isFunction("mouseReleased")) {

Callers 2

mousePressedMethod · 0.80
mousePressedMethod · 0.80

Calls 2

lua_getglobalFunction · 0.85
lua_pushintegerFunction · 0.85

Tested by

no test coverage detected