Using pak to hide assets issues


I’m trying to make a .pak file for my assets including sounds, graphics, xmls.
I use this :

<library name="default" type="pak" />
<assets path="assets/graphic" library="default"/>
<assets path="assets/sounds" library="default"/>

But it doesn’t generate any .pak files and those folder and files are present in the build.
And at runtime it gives me this error : "there is no asset library named “default”

I’m not sure what am I doing wrong with this.

Openfl 6.2.2
Hxcpp 3.4.188
Lime 5.7.1

Oh I figured it got implemented in openfl 7.0
I gotta upgrade… 2 days before release that’s gonna be fun. :scream:

1 Like

Error: Could not process argument bin/windows/haxe/release.hxml (file not found)
invalid character: /
Oh no :scream:

Check if that file actually exists, and also try a clean build.

I’m also curious how this works, because if i use type=“zip” then Assets.getText() for example reads the compressed data instead of the uncompressed one (and throws a runtime error of course)

So I managed to upgrade to the new Openfl, for that I had to switch Starling version from 1.8 to 2.0
It was not so smooth because of new syntaxes and all.
The pak is created now, I’m just wondering how to use it because I use Starling AssetManager to handle graphics.
The reason is most of them are Texture Atlases with a duo xml + png. Starling handle this well and it’s easy to use them inside Starling as it is build for that.
I can’t figure how to enqueue paked assets to Starling assets manager ?
Any help would be greatly appreciated !

I’ve seen the pattern before where you load the assets using OpenFL’s Assets class first, then register them in the Starling assets manager. I think that’s how we handle it in the Starling demo?

@igazine Are you calling Assets.getText on a whole asset library, or on a single asset from the library?

i’ve noticed that when using this default library to pack/compress the assets, the progress bar of the default preloader doesn’t work anymore, it just shows empty all the way through-out the loading. do we need to implement a custom preloader to somehow get the progress from some other source?