From 3c35a616ccbc78ff2e8af7134fb545930be49a7b Mon Sep 17 00:00:00 2001 From: Andreas Schaafsma Date: Sat, 12 Apr 2025 00:20:20 +0200 Subject: [PATCH] working --- standalone-openfl-app/src/Main.hx | 8 ++++++++ standalone-openfl-app/src/ManifestResources.hx | 13 +++++++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/standalone-openfl-app/src/Main.hx b/standalone-openfl-app/src/Main.hx index 79356a69..4188823c 100644 --- a/standalone-openfl-app/src/Main.hx +++ b/standalone-openfl-app/src/Main.hx @@ -18,5 +18,13 @@ class Main extends Sprite { var testAsset = openfl.Assets.getText("img/placeholder.txt"); trace("Successfully loaded asset: " + testAsset); + + // var testLogo = Assets.logo; + // trace("Successfully loaded logo asset: " + testLogo); + // var testImage = Assets.images + "/logo.png"; + var testImage = openfl.Assets.getPath("logo.png"); + trace("Successfully loaded image asset: " + testImage); + this.addChild(new openfl.display.Bitmap(openfl.Assets.getBitmapData(testImage))); + } } diff --git a/standalone-openfl-app/src/ManifestResources.hx b/standalone-openfl-app/src/ManifestResources.hx index 0696fb2c..6b60f0ce 100644 --- a/standalone-openfl-app/src/ManifestResources.hx +++ b/standalone-openfl-app/src/ManifestResources.hx @@ -19,14 +19,19 @@ import sys.FileSystem; var manifestDirPath = Path.join(["manifest"]); var manifests = FileSystem.readDirectory(manifestDirPath); for (manifest in manifests) { + trace(manifest); if (StringTools.endsWith(manifest, ".json")) { var manifestPath = Path.join([manifestDirPath, manifest]); - loadManifest(manifestPath); + loadManifest(manifestPath, manifest); } + else{ + throw("we eating shit tonight"); + + } } } - public static function loadManifest(manifestPath) { + public static function loadManifest(manifestPath, manifestName) { if (!FileSystem.exists(manifestPath)) { trace("Manifest file not found: " + manifestPath); return; @@ -38,8 +43,8 @@ import sys.FileSystem; var library = AssetLibrary.fromManifest(manifest); if (library != null) { preloadLibraries.push(library); - preloadLibraryNames.push("default"); - LimeAssets.registerLibrary("default", library); + preloadLibraryNames.push(manifestName); + LimeAssets.registerLibrary(manifestName, library); } } } catch (e:Dynamic) {