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", "[http://server.com/explode.png](http://server.com/explode.png)");
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.