hello developers is there any why to show Loading screen while executing loadSounds function (this is my function that will loads game sounds ) it takes time to be loaded i am using director class
thanks in advance
[import]uid: 74537 topic_id: 21815 reply_id: 321815[/import]
Here’s my splash.lua i use for my games.
At the bottom i use a timer.performWithDelay of 2 seconds. You can change that to the time you need to load your sounds/music, before it continues loading the main menu.
[code]
module(…, package.seeall)
new = function ( params )
– Params
– Params
– Groups
local localGroup = display.newGroup()
– Your code here
local background = display.newImage( “splash.jpg”, true )
– Inserts
localGroup:insert( background )
background.alpha = 0
transition.to( background, { time=3000, alpha=1.0} )
local function listener( event )
_G.BackgroundMusic = audio.loadStream(“audio/music/main.mp3”)
audio.play( _G.BackgroundMusic, { channel=0, loops=-1 } )
_G.MainSound = audio.loadSound(“main.mp3”)
_G.GameSound = audio.loadSound(“game.mp3”)
director:changeScene( “menu”, “Fade” )
end
timer.performWithDelay(3000, listener,1)
– MUST return a display.newGroup()
return localGroup
end
[/code] [import]uid: 50459 topic_id: 21815 reply_id: 86611[/import]
duplicated post [import]uid: 74537 topic_id: 21815 reply_id: 86617[/import]