Mesen-X/GUI.NET/Dependencies/LuaScripts/DrawMode.lua
Jeremy Chadwick a891307efc Debugger: Clean up Lua examples (#627)
- Remove extraneous semi-colons
- Remove spaces after opening paren on functions
- Remove trailing spaces on lines
- Add newlines as last byte of file where applicable
2019-05-22 20:09:27 -04:00

30 lines
662 B
Lua

-----------------------
-- Name: Draw Mode
-- Author: upsilandre
-----------------------
-- Allows you to draw an overlay over the game's screen by left-clicking with the mouse.
-- Right-click to clear the overlay.
-----------------------
function Main()
mouse = emu.getMouseState()
if mouse.left then
if not hold then
hold = true
else
emu.drawLine(oldX, oldY, mouse.x, mouse.y, 0xFF0000, 10000000)
end
oldX = mouse.x
oldY = mouse.y
else
hold = false
end
if mouse.right then
emu.clearScreen()
end
end
hold = false
emu.addEventCallback(Main, emu.eventType.endFrame)
emu.displayMessage("Script", "Draw Mode")