Phaser API Documentation

path: string


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

this.load.path = "images/sprites/";
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.)

If you set this property directly then it must end with a "/". Alternatively, call setPath() and it'll do it for you.

Default: ''
Since: 3.0.0