Fenopiù

Multiple upload recursively

Recommended Posts

Good morning!

I've a (really probably) noob question.

I have to preload all the file in one folder and its subfolder.

If I know before the upload all the stuff stored in these folders I can easly do it with

game.load.images([keys], [urls?]);

or

game.load.pack(key, url?, data?, callbackContext?);

but if I don't want to edit multiple times the string or json file (in example to have the same code valid for multiple projects or if I have some stuff now and in the future a lot more), there is a way to do it?

I've google for a while finding nothing for Phaser, nor Typescript nor JavaScript.

Thanks to whoever can help me! :-)

Share this post


Link to post
Share on other sites
On 11/28/2017 at 8:32 AM, Fenopiù said:

and in the future a lot more), there is a way to do it?

I've google for a while finding nothing for Phaser, nor Typescript nor JavaScript.

With Phaser Editor you can create an asset-pack.json file very easy, with a dedicated UI for it, and you can use a copy of the assets+pack in different projects. Actually, you can create different pack files to share common assets in different projects, and create additional packs for the particularities of each game.

You can try the evaluation copy and check if it is what you need. Just to mention that you can use Phaser Editor for assets management (and if you like, visual scenes creation too) but keep coding in the editor of your choice.

Take a look at the related Phaser Editor doc: http://phasereditor.boniatillo.com/docs/assets_manager.html

We updated this tutorial too, with a step by step guide and source code: https://gamedevacademy.org/make-a-mario-style-platformer-with-the-phaser-editor/

By the way, if you are using common assets in different projects, probably it is convenient for you to create prefabs (assets+behaviors) commons to different projects, you can do it with Phaser Editor too, just try the Phaser Example Project wizard, and select any of the examples shown in the Phaser Editor category: http://phasereditor.boniatillo.com/docs/first_steps.html#phaser-example-project-wizard

 

Regards

Arian

Share this post


Link to post
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.