not working yet!!

This commit is contained in:
Yoshman29
2022-11-19 03:13:09 +01:00
parent a3fb28b502
commit 0e434e8d61
4 changed files with 30 additions and 3 deletions
+1 -1
View File
@@ -1 +1 @@
1296
1307
Binary file not shown.
+25 -1
View File
@@ -269,7 +269,31 @@ class CoolUtil
public static function loadFrames(path:String, Unique:Bool = false, Key:String = null):FlxFramesCollection {
var noExt = Path.withoutExtension(path);
if (Assets.exists('$noExt/Animation.json')
if (Assets.exists('$noExt/1.png')) {
// MULTIPLE SPRITESHEETS!!
var graphic = FlxG.bitmap.add("flixel/images/logo/default.png", false, '$noExt/mult');
var frames = FlxAtlasFrames.findFrame(graphic);
if (frames != null)
return frames;
trace("no frames yet for multiple atlases!!");
var spritesheets = [];
var cur = 1;
var finalFrames = new FlxFramesCollection(graphic, ATLAS);
while(Assets.exists('$noExt/$cur.png')) {
spritesheets.push(loadFrames('$noExt/$cur.png'));
cur++;
}
for(frames in spritesheets)
if (frames != null && frames.frames != null)
for(f in frames.frames)
if (f != null) {
finalFrames.frames.push(f);
f.parent = frames.parent;
}
return finalFrames;
} else if (Assets.exists('$noExt/Animation.json')
&& Assets.exists('$noExt/spritemap.json')
&& Assets.exists('$noExt/spritemap.png')) {
// TODO: Credit Smokey555!!
+4 -1
View File
@@ -115,7 +115,10 @@ class Paths
inline static public function image(key:String, ?library:String, checkForAtlas:Bool = false)
{
var atlasPath = checkForAtlas ? getPath('images/$key/spritemap.png', IMAGE, library) : null;
return (checkForAtlas && OpenFlAssets.exists(atlasPath)) ? atlasPath.substr(0, atlasPath.length - 14) : getPath('images/$key.png', IMAGE, library);
var multiplePath = checkForAtlas ? getPath('images/$key/1.png', IMAGE, library) : null;
if (atlasPath != null && OpenFlAssets.exists(atlasPath)) return atlasPath.substr(0, atlasPath.length - 14);
if (multiplePath != null && OpenFlAssets.exists(multiplePath)) return multiplePath.substr(0, multiplePath.length - 6);
return getPath('images/$key.png', IMAGE, library);
}
inline static public function script(key:String, ?library:String, isAssetsPath:Bool = false) {