proper layering

This commit is contained in:
Cameron Taylor 2021-06-15 21:15:06 -04:00
parent e120578642
commit 4137687f26
3 changed files with 23 additions and 10 deletions

View file

@ -10,8 +10,9 @@ class AnimTestStage extends FlxState
{
var bg:FlxSprite = FlxGridOverlay.create(32, 32);
add(bg);
bg.scrollFactor.set();
var swag:FlxAnimate = new FlxAnimate(0, 0);
var swag:FlxAnimate = new FlxAnimate(200, 200);
add(swag);
super.create();

View file

@ -38,6 +38,13 @@ class FlxAnimate extends FlxSymbol
{
super.draw();
if (FlxG.keys.justPressed.ONE)
{
trace("-------------------------------------");
trace('CUR FRAME: ' + daFrame);
trace('--------------');
}
renderFrame(coolParse.AN.TL, coolParse, true);
if (FlxG.keys.justPressed.E)
@ -55,8 +62,6 @@ class FlxAnimate extends FlxSymbol
}
}
var curFrame:Int = 0;
// notes to self
// account for different layers
var playingAnim:Bool = false;

View file

@ -1,6 +1,7 @@
package animate;
import flixel.FlxCamera;
import flixel.FlxG;
import flixel.FlxSprite;
import flixel.graphics.frames.FlxFrame.FlxFrameAngle;
import flixel.math.FlxAngle;
@ -29,11 +30,6 @@ class FlxSymbol extends FlxSprite
var symbolAtlasShit:Map<String, String> = new Map();
override function draw()
{
super.draw();
}
public static var nestedShit:Map<Int, Array<FlxSymbol>> = new Map();
var symbolMap:Map<String, Animation> = new Map();
@ -47,6 +43,9 @@ class FlxSymbol extends FlxSprite
{
for (layer in TL.L)
{
if (FlxG.keys.justPressed.TWO)
trace(layer.LN);
// layer.FR.reverse();
// var frame = layer.FR[0]
@ -79,11 +78,12 @@ class FlxSymbol extends FlxSprite
// spr.origin.y += origin.y;
spr.antialiasing = true;
// if (layer.LN != 'head')
spr.draw();
if (traceShit)
if (FlxG.keys.justPressed.ONE)
{
trace(element.ASI.N);
trace("ASI - " + layer.LN + ": " + element.ASI.N);
}
}
else
@ -113,6 +113,13 @@ class FlxSymbol extends FlxSprite
// nestedShit.oldMatrix = element.SI.M3D;
if (FlxG.keys.justPressed.ONE)
{
trace("SI - " + layer.LN + ": " + element.SI.SN);
}
nestedSymbol.TL.L.reverse();
nestedShit.hasFrameByPass = true;
nestedShit.nestDepth = nestDepth + 1;
nestedShit.renderFrame(nestedSymbol.TL, coolParsed);