Softmixt Posted August 17, 2016 Share Posted August 17, 2016 Hi , I start a few weeks ago with Phaser and I have some problems that I couldn't find a solution yet so what I actually want to do is this: I want where a "load bar" is loaded to se a background image instead of solid color so my code is : /* BOOT SIDE */ var boot = function ( game ) { }; boot.prototype = { init : function () { } , preload : function () { this.game.stage.backgroundColor = "#6cb2f3"; this.game.load.image ( 'loader' , 'sprites/images/loader.png' ); } , create : function () { // Set background for our game this.game.state.start ( "Preload" ); } }; /* PRELOAD SIDE */ var preload = function ( game ) { }; preload.prototype = { preload : function () { // the other assets ... this.game.load.image ( 'background' , 'sprites/images/background.png' ); this.preloadBar = this.add.sprite( 150, 550, 'loader'); this.load.setPreloadSprite(this.preloadBar); } , create : function () { console.log ( "Load the preloader .." ); this.game.state.start ( "GameStart" ); } }; The loader image is working same as background color but instead of a background color i want to load an a image . thanks . Link to comment Share on other sites More sharing options...
TickleMeElmo Posted August 17, 2016 Share Posted August 17, 2016 Softmixt 1 Link to comment Share on other sites More sharing options...
Softmixt Posted August 17, 2016 Author Share Posted August 17, 2016 Thanks that is exactly what I need . Link to comment Share on other sites More sharing options...
Recommended Posts