loader.maxRetries is a new Game Config option to set the number of retries a file will attempt to load. The default is 2.

This commit is contained in:
Richard Davey 2024-08-07 15:43:25 +01:00
parent 4021fa50fa
commit ca4e2da432
2 changed files with 6 additions and 0 deletions

View file

@ -530,6 +530,11 @@ var Config = new Class({
*/
this.loaderTimeout = GetValue(config, 'loader.timeout', 0);
/**
* @const {number} Phaser.Core.Config#loaderMaxRetries - The number of times to retry a file load if it fails.
*/
this.loaderMaxRetries = GetValue(config, 'loader.maxRetries', 2);
/**
* @const {boolean} Phaser.Core.Config#loaderWithCredentials - Optional XHR withCredentials value.
*/

View file

@ -14,4 +14,5 @@
* @property {string[]} [localScheme] - An optional array of schemes that the Loader considers as being 'local' files. Defaults to: `[ 'file://', 'capacitor://' ]` if not specified.
* @property {boolean} [withCredentials=false] - Optional XHR withCredentials value.
* @property {string} [imageLoadType='XHR'] - Optional load type for image, `XHR` is default, or `HTMLImageElement` for a lightweight way.
* @property {number} [maxRetries=2] - The number of times to retry the file load if it fails.
*/