diff --git a/templates/haxe/DefaultAssetLibrary.hx b/templates/haxe/DefaultAssetLibrary.hx index c18295306..579571601 100644 --- a/templates/haxe/DefaultAssetLibrary.hx +++ b/templates/haxe/DefaultAssetLibrary.hx @@ -315,14 +315,15 @@ class DefaultAssetLibrary extends AssetLibrary { #else if (className.exists (id)) { - var fontClass = className.get (id); return cast (Type.createInstance (fontClass, []), Image); } else { - + #if tvos + return Image.fromFile ("assets/" + path.get (id)); + #else return Image.fromFile (path.get (id)); - + #end } #end @@ -711,7 +712,7 @@ class DefaultAssetLibrary extends AssetLibrary { if (!className.exists (asset.id)) { - #if ios + #if ios || tvos path.set (asset.id, "assets/" + asset.path); #else path.set (asset.id, asset.path);