Jump to content

Loader


Shepless
 Share

Recommended Posts

Hi All,

 

New guy here with a question regarding asset loading. I've scoured these forums, the Phaser source and couldn't figure this out (if it is even possible). Is it possible to create a new instance of Phaser.Loader without a game instance? From the source it appears not. This may seem like a strange request but let me explain the use case:

 

I am working on a single page application that allows navigation between different games, each game is wrapped in a custom <phaser></phaser> directive that is responsible for creating a new Phaser.Game instance. Angular allows you to render the navigated page once a set of async tasks have been completed (using promises). The <phaser> directive is contained within the page being navigated to, so ideally I would like to load assets prior to the page being loaded and Phaser.Game being created so the navigation is more seamless. There's a whole bunch of other stuff happening during this process also but is a bit outside the scope of this question, so I've omitted those. So in a nutshell this is the process I'd like to achieve:

 

game link clicked ---> angular navigation starts ---> Phaser.Loader() loads assets ---> Asset load complete ---> Angular page change ---> <phaser> directive creates new Phaser.Game with the previously loaded assets injected into it

 

I'm trying to avoid a "preload" splash screen for each game simply because the branding is the same across all games and is not required and would provide the user with a "dis-jointed" experience.

 

Any help is greatly appreciated.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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