farhan Posted September 7, 2018 Share Posted September 7, 2018 I just started to play around with Phaser 3. One major thing, why Phaser 3 Don't Allow Loading Data URI? Phaser 2 works great with data URI but not Phaser 3. I found a guide for how to load data uri but there are bunch of missing stuff like how to load a atlas and json spritesheet or how to load sound without json, or how to load video? I wish Phaser 3 were like 2 which is seamless way to load data uri without needing to use hacky way to them. The best would be something like Phaser 2, just pass data uri instead of file path. This would be a great addition for Phaser 3. Not really an addition but re-add I hope there are tutorial in more detail on how to load data URIs. [email protected] 1 Link to comment Share on other sites More sharing options...
rich Posted September 7, 2018 Share Posted September 7, 2018 Use v2 if you need this, there are no plans to support data URIs natively, as they just don't work properly with xhr. Link to comment Share on other sites More sharing options...
Damian Pastorini Posted September 7, 2018 Share Posted September 7, 2018 Hi @farhan, I'm not Phaser expert (actually, 2 weeks with it ), but I'm having issues using load.spritsheet, and in the middle of debugging saw something that maybe will help you: In the preload method you could try by using the "baseUrl" attribute, like: preload(){ this.load.baseURL = 'http://external-url.com/'; } Give it a try it may work, I'm doing the same to see if that fix my issues Link to comment Share on other sites More sharing options...
[email protected] Posted September 9, 2018 Share Posted September 9, 2018 On 9/8/2018 at 5:20 AM, farhan said: I found a guide for how to load data uri but there are bunch of missing stuff like how to load a atlas and json spritesheet or how to load sound without json, or how to load video? Hi farhan, Can you tell me where can I find this "GUIDE"? I'm using images uploaded by players to play games, those images are stored inside mysql in the form of base64 strings. I don't know how to load it! Thanks! Link to comment Share on other sites More sharing options...
farhan Posted September 11, 2018 Author Share Posted September 11, 2018 In the main Phaser site they have a link to this site https://supernapie.com/blog/loading-assets-as-data-uri-in-phaser-3 I chatted to this person and they say the guide was made based on the project they did, and those are all the only information available for now. If someone else have tried loading other data uri like I mentioned above, it would be great if you can share Link to comment Share on other sites More sharing options...
farhan Posted September 15, 2018 Author Share Posted September 15, 2018 On 9/7/2018 at 7:18 PM, Damian Pastorini said: Hi @farhan, I'm not Phaser expert (actually, 2 weeks with it ), but I'm having issues using load.spritsheet, and in the middle of debugging saw something that maybe will help you: In the preload method you could try by using the "baseUrl" attribute, like: preload(){ this.load.baseURL = 'http://external-url.com/'; } Give it a try it may work, I'm doing the same to see if that fix my issues Thanks for the tip. But I am not loading external assets but in the game code itself because I am making a project where I have to have all assets data in one index. Which is by using data URI not URL it is a base64 data. By using data URI you don't have to provide the image or audio or video files but the data of those files in strings. This is one of the sites I am using to convert images files into base64 data URI. https://www.base64-image.de/ Link to comment Share on other sites More sharing options...
Shoaib Aslam Posted March 18, 2019 Share Posted March 18, 2019 On 9/12/2018 at 12:42 AM, farhan said: In the main Phaser site they have a link to this site https://supernapie.com/blog/loading-assets-as-data-uri-in-phaser-3 I chatted to this person and they say the guide was made based on the project they did, and those are all the only information available for now. If someone else have tried loading other data uri like I mentioned above, it would be great if you can share Hi @farhan I followed this tutorial and was able to add images and sounds successfully. Any idea how I can convert fonts into base64 and then use them in phaser 3. Thanks Link to comment Share on other sites More sharing options...
Recommended Posts