Jump to content

Dont understand how to preload preloader


Recommended Posts

I'm new to Phaser and I like it. It has everything I need to make a new html5 game quickly but there is a problem:

In the examples provided there is no any preloader example.


All we know that preloader must have it's resources preloaded in order to display some kind of beautiful background or animation while loading the rest of data.

I've tried adding onLoadComplete listener and then, when preloader resources got downloaded, there is no hope on loading the game data. GameInstance.loader just shuts down and never invokes even after reset();

I suppose there are some state changing mechanisms for that, but I would like to avoid those deeps. 


There is no documentation on that and I ask you to help me with that weird situation.

Link to comment
Share on other sites

The data is loaded in boot for the preloader. It goes in order so if you wanted to add backdrops and loader bars you'd do the initial image loading in boot, then you'd crop and animate in the preloader itself.

If you look in the source in the resources there is a basic template with code already in it for preloading images and image bars. Also another VERY worthy thing to use is Yeoman.

You can have a modular file set up and it constructs the basics of a state set up but then exports it (like compiling) to a single game file.

Credits to Codevinsky for this:


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...