1 decade ago by KPDwyer
Hey guys,
I just spent some time figuring out a way to use images in my loading screen. My result looks something like this:
in main.js:
and then in my customer loader class' draw method (impact-splash-loader.js) I used
Now, I recognize this is not as optimal as using the paths and curves like the impact custom loader. I also realize I'm effectively waiting for my loading screen to load so I can load the game (silly). but if its a small image and I barely notice the time, is this going to affect my game in any other negative manner?
I just spent some time figuring out a way to use images in my loading screen. My result looks something like this:
in main.js:
ig.global.LoadImage = new Image(); ig.global.LoadImage.src = "media/IAmAnImage.png" ig.global.LoadImage.onload = function(){ ig.main('#canvas', MyGame, 60, ig.ua.viewport.width/2, ig.ua.viewport.height/2, 2, ig.ImpactSplashLoader); }
and then in my customer loader class' draw method (impact-splash-loader.js) I used
ig.system.context.drawImage(ig.global.LoadImage,100,100);
Now, I recognize this is not as optimal as using the paths and curves like the impact custom loader. I also realize I'm effectively waiting for my loading screen to load so I can load the game (silly). but if its a small image and I barely notice the time, is this going to affect my game in any other negative manner?