Loader#setPreloadSprite()

setPreloadSprite(sprite, direction)

Set a Sprite to be a "preload" sprite by passing it to this method.

A "preload" sprite will have its width or height crop adjusted based on the percentage of the loader in real-time.
This allows you to easily make loading bars for games.

The sprite will automatically be made visible when calling this.

Parameters
Name Type Argument Default Description
sprite Phaser.Sprite | Phaser.Image

The sprite or image that will be cropped during the load.

direction number <optional>
0

A value of zero means the sprite will be cropped horizontally, a value of 1 means its will be cropped vertically.

Source code: loader/Loader.js (Line 338)
doc_phaser
2017-02-14 10:54:32
Comments
Leave a Comment

Please login to continue.