This is the Default HaxeFlixel Themed Preloader You can make your own style of Preloader by overriding FlxPreloaderBase and using this class as an example. To use your Preloader, simply change Project.xml to say: <app preloader="class.path.MyPreloader" />

Constructor

@:value({ MinDisplayTime : 0 })new(MinDisplayTime:Float = 0, ?AllowedURLs:Array<String>)

Initialize your preloader here.

super(0, ["test.com", FlxPreloaderBase.LOCAL]); // example of site-locking
super(10); // example of long delay (10 seconds)

Methods

update(Percent:Float):Void

Update is called every frame, passing the current percent loaded. Use this to change your loading bar or whatever.

Parameters:

Percent

The percentage that the project is loaded

Inherited Variables

Defined by FlxBasePreloader

allowedURLs:Array<String>

List of allowed URLs for built-in site-locking. Set it in FlxPreloader's constructor as: ['http://adamatomic.com/canabalt/', FlxPreloader.LOCAL];

@:value(0)minDisplayTime:Float = 0

Change this if you want the flixel logo to show for more or less time. Default value is 0 seconds (no delay).

@:value("It appears the website you are using is hosting an unauthorized copy of this game. " + "Storage or redistribution of this content, without the express permission of the " + "developer or other copyright holder, is prohibited under copyright law.\n\n" + "Thank you for your interest in this game! Please support the developer by " + "visiting the following website to play the game:")siteLockBodyText:String = "It appears the website you are using is hosting an unauthorized copy of this game. " + "Storage or redistribution of this content, without the express permission of the " + "developer or other copyright holder, is prohibited under copyright law.\n\n" + "Thank you for your interest in this game! Please support the developer by " + "visiting the following website to play the game:"

The body text to display on the sitelock failure screen. NOTE: This string should be reviewed for accuracy and may need to be localized.

To customize this variable, create a class extending FlxBasePreloader, and override its value in the constructor.

Available since

4.3.0

.

See also:

  • siteLockTitleText

@:value("Sorry.")siteLockTitleText:String = "Sorry."

The title text to display on the sitelock failure screen. NOTE: This string should be reviewed for accuracy and may need to be localized.

To customize this variable, create a class extending FlxBasePreloader, and override its value in the constructor:

class Preloader extends FlxBasePreloader
{
    public function new():Void
    {
        super(0, ["http://placeholder.domain.test/path/document.html"]);

        siteLockTitleText = "Custom title text.";
        siteLockBodyText = "Custom body text.";
    }
}
Available since

4.3.0

.

@:value(0)siteLockURLIndex:Int = 0

The index of which URL in allowedURLs will be triggered when a user clicks on the Site-lock Message. For example, if allowedURLs is ['mysite.com', 'othersite.com'], and siteLockURLIndex = 1, then the user will go to 'othersite.com' when they click the message, but sitelocking will allow either of those URLs to work. Defaults to 0.

Inherited Methods

Defined by FlxBasePreloader

onInit():Void

This function is called externally to initialize the Preloader.

onLoaded():Void

This function is called EXTERNALLY once the movie has actually finished being loaded. Highly recommended you DO NOT override.

onUpdate(bytesLoaded:Int, bytesTotal:Int):Void

This function is called each update to check the load status of the project. It is highly recommended that you do NOT override this.