lovedos-template/game/main.lua

46 lines
1.1 KiB
Lua

if love.system.getOS() ~= 'DOS' then
local lick = require "3rd.lick"
lick.updateAllFiles = true
end
local platform = require "platform.platform"
local ttf
local bf
local bfi
local function drawText(str, x, y)
local font = love.graphics.getFont()
love.graphics.print(str, x - font:getWidth(str) / 2, y - font:getHeight() / 2)
end
function love.load()
platform.init()
ttf = love.graphics.newFont()
bf = love.graphics.newImageFont("font.png",
" abcdefghijklmnopqrstuvwxyz" ..
"ABCDEFGHIJKLMNOPQRSTUVWXYZ0" ..
"123456789.,!?-+/():;%&`'*#=[]\"")
bfi = love.graphics.newImage("font.png")
end
function love.draw()
platform.drawStart()
love.graphics.clear()
love.graphics.setFont(ttf)
drawText('Hellorld!', 160, 100)
love.graphics.setFont(bf)
love.graphics.print(" abcdefghijklmnopqrstuvwxyz", 0, 110)
love.graphics.print("ABCDEFGHIJKLMNOPQRSTUVWXYZ0", 0, 130)
love.graphics.print("123456789.,!?-+/():;%&`'*#=[]\"", 0, 150)
love.graphics.draw(bfi, 0, 170)
platform.drawEnd()
end
function love.keypressed(key)
if key == "escape" then
os.exit()
end
end