Cary Crusiau Posted April 3, 2014 Share Posted April 3, 2014 Hello, Is it possible to add a custom logo within the loader? I tried to add onevar logo = new game.Sprite('media/logo.png');inside the initStage function but received the following error: "Uncaught Error: The frameId “media/logo.png” does not exist in the texture cache.” I tried with 'Sprite.fromImage' but received this other error: "Uncaught TypeError: undefined is not a function" TIA for your help! Quote Link to comment Share on other sites More sharing options...
enpu Posted April 3, 2014 Share Posted April 3, 2014 You get that error because that image is not yet loaded, you see the loader is there to load that image I would suggest you to use Data URI's on loader images, example:var dataURI = 'data:YourDataURI';var sprite = new game.Sprite(game.Texture.fromImage(dataURI));Online Data URI converter:http://websemantics.co.uk/online_tools/image_to_data_uri_convertor/ In Panda.js 1.3.0 you can easily change loader logo with:game.Loader.logo = 'MyLogoDataURI'; Quote Link to comment Share on other sites More sharing options...
Cary Crusiau Posted April 3, 2014 Author Share Posted April 3, 2014 Hi enpu, Thanks for your quick reply. The first method works like a charm. I downloaded and installed Panda.js 1.3.0 to test the second method but now my game - based on Flying Dog - is not working anymore. Problem within the 'scenes.js' file: http://take.ms/a43GS Same error appears within your original game. Quote Link to comment Share on other sites More sharing options...
enpu Posted April 3, 2014 Share Posted April 3, 2014 Thanks for the info! I just updated Flying Dog to support 1.3.0 Quote Link to comment Share on other sites More sharing options...
Cary Crusiau Posted April 3, 2014 Author Share Posted April 3, 2014 I'm sorry but I updated the two folders (Flying Dog and Panda.js Engine) and got another error This time in renderer.js: http://take.ms/Wkd6Q Quote Link to comment Share on other sites More sharing options...
enpu Posted April 3, 2014 Share Posted April 3, 2014 Just released Panda.js 1.3.1 with bugfixes, it should solve that issue. Let me know if it works now. Quote Link to comment Share on other sites More sharing options...
Cary Crusiau Posted April 3, 2014 Author Share Posted April 3, 2014 Issue solved! Thanks again. FYI - Version is still '1.3.0' in the last 'core.js'. Quote Link to comment Share on other sites More sharing options...
enpu Posted April 3, 2014 Share Posted April 3, 2014 Good catch! I always forgot to change that Fixed now. Quote Link to comment Share on other sites More sharing options...
Cary Crusiau Posted April 3, 2014 Author Share Posted April 3, 2014 Hello again, Still encountering problems. I'm trying to add clouds going from left to right. So, I added this function in 'scenes.js':addCloudLeftToRight: function(x, y, path, speed) {var cloudlefttoright = new CloudLeftToRight(x, y, path, {speed: speed});this.addObject(cloudlefttoright);this.stage.addChild(cloudlefttoright);}And this in 'objects.js':CloudLeftToRight = game.Sprite.extend({update: function() {this.position.x += this.speed * game.scene.cloudSpeedFactor * game.system.delta;if(this.position.x + this.width > 900) this.position.x = -200;}});Yesterday, with Panda.js 1.2.0, it was working. Today, with Panda.js 1.3.1, I got this error: "Uncaught TypeError: Cannot read property 'hasLoaded' of undefined" Quote Link to comment Share on other sites More sharing options...
enpu Posted April 3, 2014 Share Posted April 3, 2014 Sprite constructor parameters order has changed a little:http://www.pandajs.net/docs/classes/game.Sprite.html So just move path to first Quote Link to comment Share on other sites More sharing options...
Cary Crusiau Posted April 3, 2014 Author Share Posted April 3, 2014 Yesssss! Thx for pointing this! Is there a change log somewhere? Quote Link to comment Share on other sites More sharing options...
enpu Posted April 3, 2014 Share Posted April 3, 2014 https://github.com/ekelokorpi/panda.js/releases Quote Link to comment Share on other sites More sharing options...
leon456 Posted May 5, 2014 Share Posted May 5, 2014 Hi: I define a new classs as Panda = game.Sprite.extend({ path:'meida/panda.png', interactive: true});then I add the class to stagevar sprite, text;sprite = new Panda(game.system.width / 2,game.height / 2 - 100);this.stage.addChild(sprite);browser catch this error:TypeError: texture.baseTexture is undefined if(texture.baseTexture.hasLoaded) So how can I fixed this issue,thanks 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.