make actual use of fonts
This commit is contained in:
parent
5c1a0b0c19
commit
4161044dcc
@ -57,6 +57,8 @@ function barElement:draw()
|
||||
love.graphics.setColor(1, 1, 1)
|
||||
--- текст поверх
|
||||
if self.drawText then
|
||||
local font = Tree.fonts:getDefaultTheme():getVariant("small")
|
||||
love.graphics.setFont(font)
|
||||
love.graphics.printf(tostring(self.value) .. "/" .. tostring(self.maxValue), self.bounds.x,
|
||||
self.bounds.y, self.bounds.width, "center")
|
||||
end
|
||||
|
||||
@ -22,8 +22,8 @@ function endTurnButton:update(dt)
|
||||
end
|
||||
|
||||
function endTurnButton:layout()
|
||||
local font = love.graphics.newFont(16)
|
||||
self.text = love.graphics.newText(font, "end_turn")
|
||||
local font = Tree.fonts:getDefaultTheme():getVariant("headline")
|
||||
self.text = love.graphics.newText(font, "Завершить ход")
|
||||
self.bounds.width = self.text:getWidth() + 32
|
||||
self.bounds.height = self.text:getHeight() + 16
|
||||
end
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
Tree = {
|
||||
assets = (require "lib.utils.asset_bundle"):load()
|
||||
}
|
||||
Tree.fonts = (require "lib.utils.font_manager"):load("WDXL_Lubrifont_TC") -- дефолтный шрифт
|
||||
Tree.fonts = (require "lib.utils.font_manager"):load("WDXL_Lubrifont_TC"):loadTheme("Roboto_Mono") -- дефолтный шрифт
|
||||
Tree.panning = require "lib/panning"
|
||||
Tree.controls = require "lib.controls"
|
||||
Tree.level = (require "lib.level.level").new("procedural", "flower_plains") -- для теста у нас только один уровень, который сразу же загружен
|
||||
|
||||
1
main.lua
1
main.lua
@ -64,6 +64,7 @@ function love.draw()
|
||||
testLayout:draw()
|
||||
love.graphics.setColor(1, 1, 1)
|
||||
|
||||
love.graphics.setFont(Tree.fonts:getTheme("Roboto_Mono"):getVariant("medium"))
|
||||
local stats = "fps: " ..
|
||||
love.timer.getFPS() ..
|
||||
" lt: " .. lt .. " dt: " .. dt .. " mem: " .. string.format("%.2f MB", collectgarbage("count") / 1000)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user