找到script目录下的jymain.lua文件,记事本打开,在文档的最后部分,能看到如下语句:
——————————————————————————————————————————
function getkey_sp()--------------------------------
local eventtype,keypress,x,y=lib.GetMouse(1);
if eventtype==0 then
MOUSE.status='EXIT';
elseif eventtype==2 then
MOUSE.x,MOUSE.y=x,y;
elseif eventtype==3 then
if keypress==1 then
MOUSE.status='HOLD';
MOUSE.x,MOUSE.y=x,y;
MOUSE.hx,MOUSE.hy=x,y;
elseif keypress==3 then
MOUSE.status='ESC';
end
elseif eventtype==4 then
if keypress==1 then
if MOUSE.status=='HOLD' then
if MOUSE.enableclick then
MOUSE.status='CLICK';
MOUSE.x,MOUSE.y=x,y;
MOUSE.rx,MOUSE.ry=x,y;
else
MOUSE.enableclick=true;
MOUSE.status='IDLE';
MOUSE.x,MOUSE.y=x,y;
end
end
else
MOUSE.status='IDLE';
MOUSE.x,MOUSE.y=x,y;
end
end
return eventtype,keypress,x,y;
end
——————————————————————————————————————————
上述语句中,一共有八个“x,y;”,全部替换为“x/1,y/1”即可解决手机触屏位置偏移的问题。