Author Topic: Flixel-GDX PreLoader  (Read 1987 times)

sheep42

  • Member
  • **
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Flixel-GDX PreLoader
« on: Sun, Sep 20, 2015 »
Are there any examples anywhere of a FlxPreloader implementation in Flixel-GDX? Not sure if it's even possible, I've been searching for a bit and coming up empty-handed. If it's not possible, does anyone have any suggested methods for preloading with Flixel-GDX?

Thanks!

Wing Eraser

  • Guest
Re: Flixel-GDX PreLoader
« Reply #1 on: Mon, Sep 21, 2015 »

sheep42

  • Member
  • **
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Re: Flixel-GDX PreLoader
« Reply #2 on: Mon, Sep 21, 2015 »
I've implemented that preloader in the past in a standard LibGDX project. I'm just having a bit of trouble understanding FlxAssetManager compared to the LibGDX AssetManager. I'm trying to replicate the percentage and finished loading logic with Flixel, but it doesn't seem like FlxAssetManager has the getPercentage() or update() methods used in the original. Is there something I'm missing?

What it looks like with LibGDX:
Code: [Select]
if (game.assetManager.update()) { // Load some, will return true if done
// loading
game.setScreen(new MenuScreen(game));
}

// Interpolate the percentage to make it more smooth
percent = Interpolation.linear.apply(percent, game.assetManager.getProgress(), 0.1f);

Also, thanks for always being on top of the forums your answers have always been very helpful. :)

sheep42

  • Member
  • **
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Re: Flixel-GDX PreLoader
« Reply #3 on: Mon, Sep 21, 2015 »
I actually figured it out, I just ended up using the LibGDX AssetManager instead of FlxAssetManager. Thanks again!