Phaser API Documentation



The value of path, if set, is placed before any relative file path given. For example:

this.load.image("ball", "ball.png");
this.load.image("tree", "level1/oaktree.png");
this.load.image("boom", "[](");

Would load the ball file from images/sprites/ball.png and the tree from images/sprites/level1/oaktree.png but the file boom would load from the URL given as it's an absolute URL.

Please note that the path is added before the filename but after the baseURL (if set.)

Once a path is set it will then affect every file added to the Loader from that point on. It does not change any file already in the load queue. To reset it, call this method with no arguments.


name type arguments description
path string <optional>

The path to use. Leave empty to reset.


This Loader object.

Since: 3.0.0