mirror of
https://gitea.com/SweetSea-ButImNotSweet/tromi_mobile.git
synced 2025-01-08 17:33:09 +08:00
Redesign loading screen
This commit is contained in:
39
main.lua
39
main.lua
@@ -18,28 +18,17 @@ end
|
||||
CONFIG_FILE = 'config.sav'
|
||||
HIscoreFILE = 'hiscores.sav'
|
||||
|
||||
-- Text "LOADING..."
|
||||
local loaded = {}
|
||||
local last_loading
|
||||
local loadedCounter = 0
|
||||
LOADING_IMAGE_FILE = love.graphics.newImage('res/loading.png')
|
||||
--- Show the loading text while we are loading resources<br>
|
||||
--- **WARNING**: should only be used while loading the game!
|
||||
function ShowLoadingText(thing)
|
||||
if last_loading then table.insert(loaded, last_loading) end
|
||||
last_loading = 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.draw(LOADING_IMAGE_FILE,0,0,0,0.5)
|
||||
drawText("Loading ".. thing .. "...", 15, 455, 1e99, "left")
|
||||
|
||||
love.graphics.flushBatch()
|
||||
love.graphics.present()
|
||||
@@ -74,16 +63,16 @@ function love.load()
|
||||
-- {type='button',x=640-160,y=380,key= 'rotate_left2',r=35,iconSize=60,alpha=0.75},
|
||||
-- {type='button',x=640-100,y=440,key= 'rotate_right',r=35,iconSize=60,alpha=0.75},
|
||||
-- {type='button',x=640-100,y=320,key='rotate_right2',r=35,iconSize=60,alpha=0.75},
|
||||
{type='button',x= 70,y=280,key= 'up',r=45,iconSize=60,alpha=0.375},
|
||||
{type='button',x= 70,y=430,key= 'down',r=45,iconSize=60,alpha=0.375},
|
||||
{type='button',x= -5,y=355,key= 'left',r=45,iconSize=60,alpha=0.375},
|
||||
{type='button',x= 145,y=355,key= 'right',r=45,iconSize=60,alpha=0.375},
|
||||
{type='button',x=640- -5,y=355,key= 'rotate_left',r=45,iconSize=60,alpha=0.375},
|
||||
{type='button',x=640-145,y=355,key= 'rotate_left2',r=45,iconSize=60,alpha=0.375},
|
||||
{type='button',x=640- 70,y=430,key= 'rotate_right',r=45,iconSize=60,alpha=0.375},
|
||||
{type='button',x=640- 70,y=280,key='rotate_right2',r=45,iconSize=60,alpha=0.375},
|
||||
{type='button',x=320- 40,y=420,key= 'menu_decide',r=35,iconSize=60,alpha=0.375},
|
||||
{type='button',x=320+ 40,y=420,key= 'menu_back',r=35,iconSize=60,alpha=0.375},
|
||||
{type='button',x= 70,y=280,key= 'up',r=45,iconSize=60,alpha=0.4},
|
||||
{type='button',x= 70,y=430,key= 'down',r=45,iconSize=60,alpha=0.4},
|
||||
{type='button',x= -5,y=355,key= 'left',r=45,iconSize=60,alpha=0.4},
|
||||
{type='button',x= 145,y=355,key= 'right',r=45,iconSize=60,alpha=0.4},
|
||||
{type='button',x=640- -5,y=355,key= 'rotate_left',r=45,iconSize=60,alpha=0.4},
|
||||
{type='button',x=640-145,y=355,key= 'rotate_left2',r=45,iconSize=60,alpha=0.4},
|
||||
{type='button',x=640- 70,y=430,key= 'rotate_right',r=45,iconSize=60,alpha=0.4},
|
||||
{type='button',x=640- 70,y=280,key='rotate_right2',r=45,iconSize=60,alpha=0.4},
|
||||
{type='button',x=320- 40,y=420,key= 'menu_decide',r=35,iconSize=60,alpha=0.4},
|
||||
{type='button',x=320+ 40,y=420,key= 'menu_back',r=35,iconSize=60,alpha=0.4},
|
||||
}
|
||||
end
|
||||
|
||||
|
||||
BIN
res/loading.png
Normal file
BIN
res/loading.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.0 MiB |
Reference in New Issue
Block a user