mirror of
https://gitea.com/SweetSea-ButImNotSweet/tromi_mobile.git
synced 2025-01-08 17:33:09 +08:00
Fix some bugs (TEST)
This commit is contained in:
11
main.lua
11
main.lua
@@ -96,14 +96,13 @@ function love.load()
|
||||
}
|
||||
end
|
||||
|
||||
local scale_factor
|
||||
function love.resize(w, h)
|
||||
scale_factor = math.min(w / 640, h / 480)
|
||||
SCREEN_SCALE_FACTOR = math.min(w / 640, h / 480)
|
||||
GLOBAL_TRANSFORM:setTransformation(
|
||||
(w - scale_factor * 640) / 2,
|
||||
(h - scale_factor * 480) / 2,
|
||||
(w - SCREEN_SCALE_FACTOR * 640) / 2,
|
||||
(h - SCREEN_SCALE_FACTOR * 480) / 2,
|
||||
0,
|
||||
scale_factor
|
||||
SCREEN_SCALE_FACTOR
|
||||
)
|
||||
end
|
||||
|
||||
@@ -152,7 +151,7 @@ end
|
||||
function love.mousemoved(x, y, dx, dy, isTouch)
|
||||
if isTouch then return end
|
||||
local x,y=GLOBAL_TRANSFORM:inverseTransformPoint(x,y)
|
||||
local dx,dy=dx/scale_factor,dy/scale_factor
|
||||
local dx,dy=dx/SCREEN_SCALE_FACTOR,dy/SCREEN_SCALE_FACTOR
|
||||
SCENE:onInputMove{type = "mouse", x = x, y = y, dx = dx, dy = dy}
|
||||
end
|
||||
function love.wheelmoved(dx, dy)
|
||||
|
||||
Reference in New Issue
Block a user