Prepared for web export
This commit is contained in:
parent
07b9fb6c4d
commit
877a9ffcda
4
conf.lua
Normal file
4
conf.lua
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
function love.conf(t)
|
||||||
|
t.window.width = 416
|
||||||
|
t.window.height = 234
|
||||||
|
end
|
20
main.lua
20
main.lua
@ -10,7 +10,7 @@ if game.OS == "Android" or game.OS == "iOS" then game.OSTYPE = "Mobile" end
|
|||||||
lg = love.graphics
|
lg = love.graphics
|
||||||
|
|
||||||
|
|
||||||
if game.OS~="Horizon" then push = require "lib/push" end
|
if game.OS~="Horizon" and game.OS~="Web" then push = require "lib/push" end
|
||||||
|
|
||||||
function love.load()
|
function love.load()
|
||||||
lg.setBackgroundColor(31/255,14/255,28/255)
|
lg.setBackgroundColor(31/255,14/255,28/255)
|
||||||
@ -26,17 +26,23 @@ function love.load()
|
|||||||
love.window.setTitle('Neutron')
|
love.window.setTitle('Neutron')
|
||||||
w,h = love.window.getDesktopDimensions()
|
w,h = love.window.getDesktopDimensions()
|
||||||
res = game.OSTYPE=="PC"
|
res = game.OSTYPE=="PC"
|
||||||
push:setupScreen(game.WIDTH, game.HEIGHT, w, h, {fullscreen = true,resizable = res, pixelperfect = game.OSTYPE~="Mobile"})
|
if game.OS~="Web" then
|
||||||
push:setBorderColor(0.161,0.157, 0.192,1)
|
push:setupScreen(game.WIDTH, game.HEIGHT, w, h, {fullscreen = true,resizable = res, pixelperfect = game.OSTYPE~="Mobile"})
|
||||||
|
push:setBorderColor(0.161,0.157, 0.192,1)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
game.scenes:main(game)
|
game.scenes:main(game)
|
||||||
end
|
end
|
||||||
|
|
||||||
function love.draw(screen)
|
function love.draw(screen)
|
||||||
if game.OSTYPE~="Horizon" then push:start() end
|
if game.OSTYPE~="Horizon" and game.OS~="Web" then push:start() end
|
||||||
game:draw(screen)
|
game:draw(screen)
|
||||||
if game.OSTYPE~="Horizon" then push:finish() end
|
if game.OSTYPE~="Horizon" and game.OS~="Web" then push:finish() end
|
||||||
|
local width
|
||||||
|
local height
|
||||||
|
width,height = lg.getDimensions()
|
||||||
|
--lg.print("OS : "..game.OS.."; OSTYPE : "..game.OSTYPE.."; WIDTH : "..width.."; HEIGHT : "..height)
|
||||||
end
|
end
|
||||||
|
|
||||||
function love.update()
|
function love.update()
|
||||||
@ -63,12 +69,12 @@ function love.gamepadaxis( joystick, axis, value )
|
|||||||
end
|
end
|
||||||
|
|
||||||
function love.resize(w, h)
|
function love.resize(w, h)
|
||||||
if game.OSTYPE~="3DS" then push:resize(w, h) end
|
if game.OSTYPE~="3DS" and game.OS ~= "Web" then push:resize(w, h) end
|
||||||
end
|
end
|
||||||
|
|
||||||
function love.mousepressed(x,y,button,istouch,presses)
|
function love.mousepressed(x,y,button,istouch,presses)
|
||||||
-- Format positions according to screen
|
-- Format positions according to screen
|
||||||
if game.OS ~= "Horizon" then
|
if game.OS ~= "Horizon" and game.OS ~="Web" then
|
||||||
x,y = push:toGame(x,y)
|
x,y = push:toGame(x,y)
|
||||||
end
|
end
|
||||||
if x~=nil and y~=nil then game:MouseCallback(x,y,presses) end
|
if x~=nil and y~=nil then game:MouseCallback(x,y,presses) end
|
||||||
|
Loading…
Reference in New Issue
Block a user