toolfunc文件拆分
This commit is contained in:
18
Zframework/wheelScroll.lua
Normal file
18
Zframework/wheelScroll.lua
Normal file
@@ -0,0 +1,18 @@
|
||||
local floatWheel=0
|
||||
function wheelScroll(y)
|
||||
if y>0 then
|
||||
if floatWheel<0 then floatWheel=0 end
|
||||
floatWheel=floatWheel+y^1.2
|
||||
elseif y<0 then
|
||||
if floatWheel>0 then floatWheel=0 end
|
||||
floatWheel=floatWheel-(-y)^1.2
|
||||
end
|
||||
while floatWheel>=1 do
|
||||
love.keypressed("up")
|
||||
floatWheel=floatWheel-1
|
||||
end
|
||||
while floatWheel<=-1 do
|
||||
love.keypressed("down")
|
||||
floatWheel=floatWheel+1
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user