Problem with wade.setLoadingImage() - stays visible
Shri

Gio,

 

I wanted to add a simple logo on game loading (so not using preload scene)

I use wade.setLoadingImage(logo).

Everything works fine on load and I see the logo image.

However, when the game is loaded and the scenes are switching, the loading logo flashes briefly.

For example, switching from the intro scene to the help scene, or switching from intro scene to play.

 

When changing scenes I use wade.loadScene(newScene,0,0,1)

 

I have tried changing the default layer.

I have tried using wade.clearCanvas() and using wade.clearScene()

But nothing seems to get rid of the loading logo.

The logo is not visible during game play, but flashes briefly when scenes are changed.

 

It seems as if the loading image is existing on some canvas which I can't seem to clear ?

 

I know you use loading images in the games on the clockwork chilli site, so I just must be missing something. In a nutshell, my code looks like this

this.load = function() {     wade.setLoadingImage('./images/ashatej_banner.jpg');     // do rest of loading stuff}this.init = function() {     // do all the initialization stuff     self.loadIntro()}this.loadIntro = function() {     // tried to add wade.clearCanvas(1);     // tried to add wade.clearScene();     wade.loadScene('./data/intro.wsc',0,0,1)}// this is used to switch scenes i.e. help, credits, game, etcthis.changeGameScene = function(newScene) {     wade.loadScene(newScene,0,0,1);}

As always, any help is appreciated

 

cheers,

Shri

All 4 Comments
Shri

Gio,

 

So I was poking around in the source code and saw how the engine creates the loading image.

I changed the load intro routine and so no it looks like this

this.loadIntro = function() {     var elem = document.getElementByClassName("loadingImage_class");     elem[0].remove();     wade.loadScene('./data/intro.wsc',0,0,1);}

It now works like I want (no residual loading image).

Is this a good way to do things ?

Am I the only one who has seen this proble ?

Should there be a call in wade that lets me clean up the loading image ?

Or should this already be handled under the hood ?

 

cheers,

Shri

Gio

Hi Shri

 

If there is a loading image set, it is displayed any time you load assets through the wade.load....() functions (as opposed to wade.preload....())

 

It's alright doing it like you did, but I think if you called wade.setLoadingImages() with no arguments, it would clear the loading image, which may be slightly more convenient. I'm not sure that works as intended though, I'll double check.

Shri

Gio,

 

I am only loading images using wade.preload().

But if you load a scene that has sprites, then the images are loaded because they don't have to be preloaded previously

So I guess that explains why I see the loading image after startup.

 

I tried using wade.setLoadingImages() with no parameters and I get a 'Get' error for an undefined file in Chrome.

 

I have concluded with adding a call to this little function at the end of the global init routine.

So, the code looks like this. It seems to work as expected.

this.init() {     // initialize everything     self.removeLoadingImage();     self.loadIntro};this.removeLoadingImage = function() {     $(".loadingImage_class").remove();};	// end removeLoadingImagethis.loadIntro = function() {     console.log('load intro scene');     wade.loadScene('./data/intro.wsc',0,0,1);};	// end loadIntro

cheers,

Shri

 

 

Gio

Thanks for the heads up Shri, I think we should make it work with a call to wade.setLoadingImages() with no parameters. I'll see if I can get that fixed

Post a reply
Add Attachment
Submit Reply
Login to Reply