Fix loading screen

This commit is contained in:
SweetSea-ButImNotSweet
2024-04-21 15:14:15 +07:00
parent 66aae1342d
commit 283e7d8f28
3 changed files with 9 additions and 8 deletions

View File

@@ -2,6 +2,10 @@
bigint = require "libs.bigint.bigint" bigint = require "libs.bigint.bigint"
number_names = require "libs.bigint.named-powers-of-ten" number_names = require "libs.bigint.named-powers-of-ten"
-- Fonts
FONT_tromi = love.graphics.newFont('res/fonts/monofonto rg.otf', 28)
FONT_big = love.graphics.newFont('res/fonts/monofonto rg.otf', 56)
-- Graphics -- Graphics
ShowLoadingText('backgrounds') ShowLoadingText('backgrounds')
local gc_newImage, gc_newVideo = love.graphics.newImage, love.graphics.newVideo local gc_newImage, gc_newVideo = love.graphics.newImage, love.graphics.newVideo

View File

@@ -23,10 +23,6 @@ function love.load()
math.randomseed(os.time()) math.randomseed(os.time())
require "settings" 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 -- Window stuffs
love.mouse.setVisible(false) love.mouse.setVisible(false)
love.window.setMode(love.graphics.getWidth(), love.graphics.getHeight(), {resizable = true}); love.window.setMode(love.graphics.getWidth(), love.graphics.getHeight(), {resizable = true});
@@ -38,11 +34,13 @@ function love.load()
-- Text "LOADING..." -- Text "LOADING..."
local loaded = {} local loaded = {}
local prev_thing
local loadedCounter = 0 local loadedCounter = 0
--- Show the loading text while we are loading resources<br> --- Show the loading text while we are loading resources<br>
--- **WARNING**: should only be used while loading the game! --- **WARNING**: should only be used while loading the game!
function ShowLoadingText(thing) function ShowLoadingText(thing)
table.insert(loaded, thing) if prev_thing then table.insert(loaded, prev_thing) end
prev_thing = thing
loadedCounter = loadedCounter + 1 loadedCounter = loadedCounter + 1
love.graphics.replaceTransform(GLOBAL_TRANSFORM) love.graphics.replaceTransform(GLOBAL_TRANSFORM)
@@ -63,7 +61,7 @@ function love.load()
-- Now it's real time to load all stuffs! -- Now it's real time to load all stuffs!
highscores = {} highscores = {}
require "load" require "load" -- Most game's resources are loaded in here
require "scene" require "scene"
require "game.vctrl" -- VCTRL require "game.vctrl" -- VCTRL

View File

@@ -1,6 +1,5 @@
local TrainingScene = SCENE:extend() local TrainingScene = SCENE:extend()
TrainingScene.title = "20G Training"
TrainingScene.title = "Max Gravity Training"
require 'settings' require 'settings'