MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / GetMousePosition

Method GetMousePosition

src/lua/LuaCallOuts.cpp:1608–1619  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1606//
1607
1608int LuaCallOuts::GetMousePosition(lua_State* L) {
1609 MainWindow* wnd = getMainWindow();
1610 if (wnd == NULL) {
1611 return luaL_pushnil(L);
1612 }
1613
1614 int mx, my;
1615 wnd->getWindow()->getMouse(mx, my);
1616 lua_pushinteger(L, mx);
1617 lua_pushinteger(L, wnd->getHeight() - my - 1);
1618 return 2;
1619}
1620
1621
1622int LuaCallOuts::GetMouseButtons(lua_State* L) {

Callers

nothing calls this directly

Calls 6

luaL_pushnilFunction · 0.85
getWindowMethod · 0.80
getMainWindowFunction · 0.50
lua_pushintegerFunction · 0.50
getMouseMethod · 0.45
getHeightMethod · 0.45

Tested by

no test coverage detected