mirror of
https://github.com/ninjamuffin99/Funkin.git
synced 2024-09-12 05:07:06 +00:00
animation fixing for FlxSymbol in progress
This commit is contained in:
parent
4137687f26
commit
1927be79f8
|
@ -16,6 +16,15 @@ class FlxSymbol extends FlxSprite
|
|||
|
||||
private var hasFrameByPass:Bool = false;
|
||||
|
||||
// Loop types shit
|
||||
public static inline var LOOP:String = 'LP';
|
||||
public static inline var PLAY_ONCE:String = 'PO';
|
||||
public static inline var SINGLE_FRAME:String = 'SF';
|
||||
|
||||
public var firstFrame:Int = 0;
|
||||
|
||||
public var daLoopType:String = 'LP'; // LP by default, is set below!!!
|
||||
|
||||
public function new(x:Float, y:Float, coolParsed:Parsed)
|
||||
{
|
||||
super(x, y);
|
||||
|
@ -47,13 +56,33 @@ class FlxSymbol extends FlxSprite
|
|||
trace(layer.LN);
|
||||
|
||||
// layer.FR.reverse();
|
||||
// var frame = layer.FR[0]
|
||||
|
||||
for (frame in layer.FR)
|
||||
// for (frame in layer.FR)
|
||||
// {
|
||||
var newFrameNum:Int = daFrame;
|
||||
|
||||
switch (daLoopType)
|
||||
{
|
||||
if (daFrame >= frame.I && daFrame < frame.I + frame.DU)
|
||||
{
|
||||
for (element in frame.E)
|
||||
case LOOP:
|
||||
var tempFrame = layer.FR[newFrameNum + firstFrame % layer.FR.length];
|
||||
newFrameNum += 0; // temp, fix later for good looping
|
||||
case PLAY_ONCE:
|
||||
newFrameNum += 0;
|
||||
case SINGLE_FRAME:
|
||||
newFrameNum = firstFrame;
|
||||
}
|
||||
|
||||
trace(daLoopType);
|
||||
trace(newFrameNum);
|
||||
trace(layer.FR.length);
|
||||
|
||||
trace(newFrameNum % layer.FR.length);
|
||||
|
||||
var swagFrame:Frame = layer.FR[newFrameNum % layer.FR.length]; // has modulo just in case????
|
||||
|
||||
// if (newFrameNum >= frame.I && newFrameNum < frame.I + frame.DU)
|
||||
// {
|
||||
for (element in swagFrame.E)
|
||||
{
|
||||
if (Reflect.hasField(element, 'ASI'))
|
||||
{
|
||||
|
@ -92,8 +121,8 @@ class FlxSymbol extends FlxSprite
|
|||
var nestedShit:FlxSymbol = new FlxSymbol(0, 0, coolParse);
|
||||
nestedShit.frames = frames;
|
||||
|
||||
var swagMatrix:FlxMatrix = new FlxMatrix(element.SI.M3D[0], element.SI.M3D[1], element.SI.M3D[4], element.SI.M3D[5],
|
||||
element.SI.M3D[12], element.SI.M3D[13]);
|
||||
var swagMatrix:FlxMatrix = new FlxMatrix(element.SI.M3D[0], element.SI.M3D[1], element.SI.M3D[4], element.SI.M3D[5], element.SI.M3D[12],
|
||||
element.SI.M3D[13]);
|
||||
|
||||
swagMatrix.concat(_matrix);
|
||||
|
||||
|
@ -115,11 +144,16 @@ class FlxSymbol extends FlxSprite
|
|||
|
||||
if (FlxG.keys.justPressed.ONE)
|
||||
{
|
||||
trace("SI - " + layer.LN + ": " + element.SI.SN);
|
||||
trace("SI - " + layer.LN + ": " + element.SI.SN + " - LOOP TYPE: " + element.SI.LP);
|
||||
}
|
||||
|
||||
nestedShit.firstFrame = element.SI.FF;
|
||||
// nestedShit.daFrame += nestedShit.firstFrame;
|
||||
|
||||
nestedSymbol.TL.L.reverse();
|
||||
|
||||
nestedShit.daLoopType = element.SI.LP;
|
||||
nestedShit.daFrame = daFrame;
|
||||
nestedShit.hasFrameByPass = true;
|
||||
nestedShit.nestDepth = nestDepth + 1;
|
||||
nestedShit.renderFrame(nestedSymbol.TL, coolParsed);
|
||||
|
@ -127,8 +161,8 @@ class FlxSymbol extends FlxSprite
|
|||
// renderFrame(nestedSymbol.TL, coolParsed);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -311,6 +345,12 @@ typedef SymbolInstance =
|
|||
/** SymbolType (Graphic, Movieclip, Button)*/
|
||||
var ST:String;
|
||||
|
||||
/** First frame*/
|
||||
var FF:Int;
|
||||
|
||||
/** Loop type (Loop, play once, single frame)*/
|
||||
var LP:String;
|
||||
|
||||
var TRP:TransformationPoint;
|
||||
var M3D:Array<Float>;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue