Phaser API Documentation

  Version: 
setPrefix([prefix])

Description:

An optional prefix that is automatically prepended to the start of every file key.

If prefix was MENU. and you load an image with the key 'Background' the resulting key would be MENU.Background.

Once a prefix 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.

Parameters:

name type arguments description
prefix string <optional>

The prefix to use. Leave empty to reset.

Returns:
Description:

This Loader object.

Since: 3.7.0