1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2025-01-01 17:57:27 +00:00

lil code comments for FlxAnimate and ParseAnimate

This commit is contained in:
Cameron Taylor 2021-09-02 19:00:01 -04:00
parent 49a5c30b90
commit 1480335bcb
3 changed files with 10 additions and 2 deletions

View file

@ -1096,6 +1096,8 @@ class ChartingState extends MusicBeatState
if (debugSavepath) if (debugSavepath)
{ {
// file path to assumingly your assets folder in your SOURCE CODE assets folder!!!
// update this later so the save button ONLY appears when you compile in debug mode!
sys.io.File.saveContent('../../../../assets/preload/data/$filename/$filename.json', data); sys.io.File.saveContent('../../../../assets/preload/data/$filename/$filename.json', data);
} }
else else

View file

@ -54,6 +54,7 @@ class FlxAnimate extends FlxSymbol
override function draw() override function draw()
{ {
// having this commented out fixes some wacky scaling bullshit? // having this commented out fixes some wacky scaling bullshit?
// or fixes drawing it twice?
// super.draw(); // super.draw();
// renderFrame(coolParse.AN.TL, coolParse, true); // renderFrame(coolParse.AN.TL, coolParse, true);
@ -85,7 +86,7 @@ class FlxAnimate extends FlxSymbol
{ {
trace(i.frameName); trace(i.frameName);
trace(i.depthString); trace(i.depthString);
trace("random lol: " + i.randomLol); // trace("random lol: " + i.randomLol);
} }
for (swagMatrix in i.matrixArray) for (swagMatrix in i.matrixArray)
@ -157,6 +158,9 @@ class FlxAnimate extends FlxSymbol
changeFrame(-1); changeFrame(-1);
} }
/**
* PARSES THE 'spritemap1.png' or whatever into a FlxAtlasFrames!!!
*/
public static function fromAnimate(Source:FlxGraphicAsset, Description:String):FlxAtlasFrames public static function fromAnimate(Source:FlxGraphicAsset, Description:String):FlxAtlasFrames
{ {
var graphic:FlxGraphic = FlxG.bitmap.add(Source); var graphic:FlxGraphic = FlxG.bitmap.add(Source);
@ -207,6 +211,7 @@ class FlxAnimate extends FlxSymbol
} }
} }
// handy json function that has some hashlink fix, see the thing in CoolUtils file to see the link / where i stole it from
class JaySon class JaySon
{ {
public static function parseFile(name:String) public static function parseFile(name:String)

View file

@ -164,6 +164,7 @@ class ParseAnimate
frameInput = frameArray[loopedFrameShit]; frameInput = frameArray[loopedFrameShit];
// see what happens when something has more than 2 layer? // see what happens when something has more than 2 layer?
// single frame stuff isn't fully implemented
} }
else else
frameInput = frameArray[frameInput]; frameInput = frameArray[frameInput];
@ -209,7 +210,7 @@ class ParseAnimate
var inputFrame:Int = element.SI.FF; var inputFrame:Int = element.SI.FF;
// JANKY FIX, MAY NOT ACCOUNT FOR ALL SCENARIOS! // JANKY FIX, MAY NOT ACCOUNT FOR ALL SCENARIOS OF SINGLE FRAME ANIMATIONS!!
if (curLoopType == "SF") if (curLoopType == "SF")
{ {
// trace("LOOP SHIT: " + inputFrame); // trace("LOOP SHIT: " + inputFrame);