mirror of
https://gitea.com/SweetSea-ButImNotSweet/tromi_mobile.git
synced 2025-01-08 17:33:09 +08:00
Update loading screen
This commit is contained in:
37
main.lua
37
main.lua
@@ -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 = {}
|
||||
|
||||
Reference in New Issue
Block a user