Jump to content

Question about asset loading


Recommended Posts

Hi there,

Can I load several different assets at a different moment inside the same scene?
I ask since I seem can't trigger preload function again (which will load different asset every time) even if I visit a scene repeatedly. 
I'm using scene switch btw.

Any help will be greatly appreciated.

Link to comment
Share on other sites

I believe you need to load the assets when the scene starts. You can create objects whenever you like, but the assets need to be loaded first.

If you want to load the same scene with different assets, you could pass data to the scene when you start it, and use that data to define which assets to load.

An example of passing data to a scene can be found here https://labs.phaser.io/edit.html?src=src\scenes\passing data to a scene.js

Link to comment
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.

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.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...