Lua Script API: URL Loading - Lokitot/FNF-SoulEngine GitHub Wiki

WARNING: This function only works with a Internet connection

Made this alternative because our current hscript support doesn't allow haxe.Http#request();

Usage:

for loading an image, do: var spr:FlxSprite = Paths.loadGraphicFromURL(url:String);. This WILL override a sprites properties, as this returns a brand new FlxSprite with the loaded image.

for loading a Sparrow spritesheet, do: spr.frames = Paths.loadSparrowAtlasFromURL(xmlUrl:String, imageUrl:String);. This will return the Sparrow Atlas frames, ready with the image.

for loading a files text data off the web, do: var str:String = Paths.loadFileFromURL(url:String);. This will return a string of the text data found from the url.

I have also added the possibility to load lua scripts straight from strings rather than files, this allows people to load a lua script straight from the web using Paths.loadFileFromURL();

There's a template of how to make it here: Online Fake BF (URL BF) - Loads a character using URL's