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