DS - fix sylus lua script to use client.transformPoint, still doesn't work since it scales down to 1x

This commit is contained in:
adelikat 2020-04-01 11:55:23 -05:00
parent f369291606
commit 2fbbe01347
1 changed files with 22 additions and 24 deletions

View File

@ -24,32 +24,30 @@ while true do
break
end
local touchStart = ds.touchScreenStart()
if touchStart then
local bufferX = client.bufferwidth()
local bufferY = client.bufferheight()
local bufferX = client.bufferwidth()
local bufferY = client.bufferheight()
local btns = joypad.get()
if movie.mode() == "PLAY" and emu.framecount() > 0 then
btns = movie.getinput(emu.framecount() - 1)
end
local x = btns['TouchX']
local y = btns['TouchY']
local isDown = btns['Touch']
-- A bit of a hack to ensure it is not drawing while mouse moving
-- on the top screen
if y == 0 then
x = 0
end
x = x + touchStart.X
y = y + touchStart.Y
Draw(x, y, bufferX, bufferY, isDown)
local btns = joypad.get()
if movie.mode() == "PLAY" and emu.framecount() > 0 then
btns = movie.getinput(emu.framecount() - 1)
end
local x = btns['TouchX']
local y = btns['TouchY']
local isDown = btns['Touch']
-- A bit of a hack to ensure it is not drawing while mouse moving
-- on the top screen
if y == 0 then
x = 0
end
pts = client.transformPoint(x, y)
local tx = pts["x"];
local ty = pts["y"];
Draw(tx, ty, bufferX, bufferY, isDown)
emu.frameadvance()
end