Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/samme/phaser-plugin-loader

A collection of small Phaser 3 loader plugins
https://github.com/samme/phaser-plugin-loader

phaser phaser3

Last synced: 2 months ago
JSON representation

A collection of small Phaser 3 loader plugins

Awesome Lists containing this project

README

        

Phaser 3 Loader Plugins
=======================

A collection of small loader plugins to help your development.

See [examples](https://codepen.io/collection/BNxZzx).

Loader Bar Plugin
-----------------

Shows a progress bar. Removed when loading is complete.

Loader Logger Plugin
--------------------

Prints to console:

- debug: loader configuration, load progress, file add/load/complete
- info: loader start, post-process, complete
- warn: loader complete with failures
- error: file load failure

Loader Text Plugin
------------------

Shows load progress and file status while loading. Removed when loading is complete.

Loader Timer Plugin
-------------------

Prints to console the time interval from start to completion.

Use
---

Add any of the plugins you need.

### Browser / UMD

```js
/* global PhaserLoaderPlugin */
new Phaser.Game({
plugins: {
scene: [
{ key: 'LoaderBar', plugin: PhaserLoaderPlugin.LoaderBarPlugin, start: true },
{ key: 'LoaderLogger', plugin: PhaserLoaderPlugin.LoaderLoggerPlugin, start: true },
{ key: 'LoaderText', plugin: PhaserLoaderPlugin.LoaderTextPlugin, start: true },
{ key: 'LoaderTimer', plugin: PhaserLoaderPlugin.LoaderTimerPlugin, start: true }
]
}
});
```

### Modules

```js
import { LoaderLoggerPlugin, LoaderTimerPlugin, LoaderBarPlugin, LoaderTextPlugin } from 'phaser-plugin-loader';

new Phaser.Game({
plugins: {
scene: [
{ key: 'LoaderBar', plugin: LoaderBarPlugin, start: true },
{ key: 'LoaderLogger', plugin: LoaderLoggerPlugin, start: true },
{ key: 'LoaderText', plugin: LoaderTextPlugin, start: true },
{ key: 'LoaderTimer', plugin: LoaderTimerPlugin, start: true }
]
}
});
```