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