Update loading screen

This commit is contained in:
Squishy (C6H12O6+NaCl+H2O)
2024-04-20 21:29:06 +07:00
parent 7d50e71269
commit c643782985
3 changed files with 76 additions and 53 deletions

View File

@@ -22,21 +22,44 @@ HIscoreFILE = 'hiscores.sav'
function love.load()
math.randomseed(os.time())
require "settings"
-- Loading font first
FONT_tromi = love.graphics.newFont('res/fonts/monofonto rg.otf', 28)
FONT_big = love.graphics.newFont('res/fonts/monofonto rg.otf', 56)
-- Window stuffs
love.mouse.setVisible(false)
love.window.setMode(love.graphics.getWidth(), love.graphics.getHeight(), {resizable = true});
love.window.setFullscreen(SETTINGS["fullscreen"])
-- Make a new transformer
GLOBAL_TRANSFORM = love.math.newTransform()
love.resize(love.graphics.getWidth(), love.graphics.getHeight())
-- Text "LOADING..."
love.graphics.setFont(love.graphics.newFont(20))
love.graphics.replaceTransform(GLOBAL_TRANSFORM)
love.graphics.clear()
love.graphics.print("Tromi is loading...\nPlease wait, don't touch anywhere or press any key!",10,0)
love.graphics.flushBatch()
love.graphics.present()
local loaded = {}
local loadedCounter = 0
--- Show the loading text while we are loading resources<br>
--- **WARNING**: should only be used while loading the game!
function ShowLoadingText(thing)
table.insert(loaded, thing)
loadedCounter = loadedCounter + 1
love.graphics.replaceTransform(GLOBAL_TRANSFORM)
love.graphics.setFont(love.graphics.newFont(20))
love.graphics.clear()
drawText(
"Loading Tromi... ["..loadedCounter.." / 3]\nPlease wait, don't touch anywhere or press any key!\n\nLoading: "..thing,
10,0,1e99,"left"
)
for i, t in pairs(loaded) do
drawText("Loaded "..t,10,80+20*i,1e99,"left")
end
love.graphics.flushBatch()
love.graphics.present()
end
-- Now it's real time to load all stuffs!
highscores = {}