Phempt Posted October 12, 2014 Share Posted October 12, 2014 Hello guys, is there a way to add sprite to the loading screen? I saw that I can change the loading screen using this method:game.Loader.inject({backgroundColor: 0xcccccc, initStage: function() { /* BACKGROUND */ this.bar = new game.Graphics(); this.bar.beginFill(0xffffff); this.bar.drawRect(0, 0, 260, 40); this.bar.position.x = game.system.width / 2 - (260 / 2); this.bar.position.y = game.system.height / 2 - (40 / 2); this.bar.scale.x = this.percent / 100; game.system.stage.addChild(this.bar); }, onPercentChange: function() { this.bar.scale.x = this.percent / 100; }});But I want to add a background and some sprites such as the logo. Can you help me? thanks a lot ^^ Quote Link to comment Share on other sites More sharing options...
Phempt Posted October 12, 2014 Author Share Posted October 12, 2014 I forgot to say that I tried to insert some sprites with: /* BACKGROUND */ var backgroundMenu = new game.Sprite('objects/backgrounds/bg.png'); game.system.stage.addChild(backgroundMenu); var backgroundBubbles = new game.Sprite('objects/backgrounds/bubbbles-bg.png'); backgroundBubbles.scale.set(0.8,0.8); backgroundBubbles.position.y = 105; game.system.stage.addChild(backgroundBubbles); /* LOGO */ var logo = new game.Sprite('objects/logo/title.png'); logo.scale.set(0.8,0.8); logo.anchor.set(0, 0); logo.position.y = 20; game.system.stage.addChild(logo); Quote Link to comment Share on other sites More sharing options...
Phempt Posted October 13, 2014 Author Share Posted October 13, 2014 I made some changes in loader.js and now I've an animated logo with a custom bar. Is there a way to add a background image for the loading scene? Quote Link to comment Share on other sites More sharing options...
enpu Posted October 14, 2014 Share Posted October 14, 2014 Just add your background image like any other sprite. Quote Link to comment Share on other sites More sharing options...
Phempt Posted October 15, 2014 Author Share Posted October 15, 2014 I used the data uri also for the backgroud, it works! Thank you ^^ Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.