diff --git a/game/font.png b/game/font.png new file mode 100644 index 0000000..b500518 Binary files /dev/null and b/game/font.png differ diff --git a/game/main.lua b/game/main.lua index e24d75f..e563296 100644 --- a/game/main.lua +++ b/game/main.lua @@ -4,21 +4,37 @@ if love.system.getOS() ~= 'DOS' then end local platform = require "platform.platform" - -function love.load() - platform.init() -end +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