experimental mobile support (maybe!!)
This commit is contained in:
parent
18d9d681b8
commit
52ee57f231
1 changed files with 15 additions and 5 deletions
20
main.lua
20
main.lua
|
@ -23,6 +23,7 @@ fonts = {}
|
||||||
cursors = {}
|
cursors = {}
|
||||||
|
|
||||||
debug = false
|
debug = false
|
||||||
|
is_mobile = love.system.getOS() == "Android" or love.system.getOS() == "iOS"
|
||||||
|
|
||||||
function newAnimation(image, width, height)
|
function newAnimation(image, width, height)
|
||||||
local animation = {}
|
local animation = {}
|
||||||
|
@ -54,7 +55,14 @@ function love.load()
|
||||||
cursors.hover = love.mouse.newCursor('assets/sprites/cursor/hand.png', sprites['cursor/hand']:getWidth()/2, sprites['cursor/hand']:getHeight()/2)
|
cursors.hover = love.mouse.newCursor('assets/sprites/cursor/hand.png', sprites['cursor/hand']:getWidth()/2, sprites['cursor/hand']:getHeight()/2)
|
||||||
cursors.drag = love.mouse.newCursor('assets/sprites/cursor/dragging.png', sprites['cursor/dragging']:getWidth()/2, sprites['cursor/dragging']:getHeight()/2)
|
cursors.drag = love.mouse.newCursor('assets/sprites/cursor/dragging.png', sprites['cursor/dragging']:getWidth()/2, sprites['cursor/dragging']:getHeight()/2)
|
||||||
|
|
||||||
love.mouse.setCursor(cursors.default)
|
if not is_mobile then
|
||||||
|
love.mouse.setCursor(cursors.default)
|
||||||
|
end
|
||||||
|
|
||||||
|
if is_mobile then
|
||||||
|
local winwidth, winheight = love.graphics.getDimensions( )
|
||||||
|
love.window.setMode(winwidth, winheight, {borderless=true, resizable=false, minwidth=705, minheight=510, fullscreen=true})
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local cursor
|
local cursor
|
||||||
|
@ -73,10 +81,12 @@ function love.update(dt)
|
||||||
if scene.update then scene.update(dt) end
|
if scene.update then scene.update(dt) end
|
||||||
bench.stopBenchmark('update')
|
bench.stopBenchmark('update')
|
||||||
|
|
||||||
if cursor then
|
if not is_mobile then
|
||||||
love.mouse.setCursor(cursor)
|
if cursor then
|
||||||
else
|
love.mouse.setCursor(cursor)
|
||||||
love.mouse.setCursor(cursors.default)
|
else
|
||||||
|
love.mouse.setCursor(cursors.default)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue