2022-03-08 08:13:53 +00:00
|
|
|
package funkin.animate;
|
2021-08-19 18:53:18 +00:00
|
|
|
|
|
|
|
import flixel.FlxSprite;
|
2022-06-12 04:02:49 +00:00
|
|
|
import flixel.input.mouse.FlxMouseEvent;
|
2021-08-19 18:53:18 +00:00
|
|
|
import flixel.util.FlxColor;
|
2022-07-22 20:11:18 +00:00
|
|
|
import funkin.animate.ParseAnimate.Frame;
|
2021-08-19 18:53:18 +00:00
|
|
|
|
|
|
|
class TimelineFrame extends FlxSprite
|
|
|
|
{
|
2021-08-20 15:01:37 +00:00
|
|
|
public var data:Frame;
|
|
|
|
|
|
|
|
public function new(x:Float, y:Float, length:Int = 0, data:Frame)
|
2021-08-19 18:53:18 +00:00
|
|
|
{
|
|
|
|
super(x, y);
|
|
|
|
|
2021-08-20 15:01:37 +00:00
|
|
|
this.data = data;
|
|
|
|
|
2021-08-19 18:53:18 +00:00
|
|
|
makeGraphic((10 * length) + (2 * (length - 1)), 10, FlxColor.RED);
|
2021-08-20 15:01:37 +00:00
|
|
|
|
2022-06-12 04:02:49 +00:00
|
|
|
FlxMouseEvent.add(this, null, null, function(spr:TimelineFrame)
|
2021-08-20 15:01:37 +00:00
|
|
|
{
|
|
|
|
alpha = 0.5;
|
|
|
|
}, function(spr:TimelineFrame)
|
|
|
|
{
|
|
|
|
alpha = 1;
|
|
|
|
}, false, true, true);
|
|
|
|
}
|
|
|
|
|
|
|
|
override function update(elapsed:Float)
|
|
|
|
{
|
|
|
|
// if (FlxG.mouse.overlaps(this, cameras[1]))
|
|
|
|
// alpha = 0.6;
|
|
|
|
// else
|
|
|
|
// alpha = 1;
|
|
|
|
|
|
|
|
if (FlxG.mouse.overlaps(this, cameras[0]) && FlxG.mouse.justPressed)
|
|
|
|
{
|
|
|
|
trace("\nFRAME DATA - \n\tFRAME NUM: " + data.I + "\n\tFRAME DURATION: " + data.DU);
|
|
|
|
|
|
|
|
for (e in data.E)
|
|
|
|
{
|
|
|
|
var elementOutput:String = "\n";
|
|
|
|
|
|
|
|
if (Reflect.hasField(e, 'ASI'))
|
|
|
|
{
|
|
|
|
elementOutput += "ELEMENT IS ASI!";
|
|
|
|
|
|
|
|
elementOutput += "\n\t";
|
|
|
|
elementOutput += "FRAME NAME: " + e.ASI.N;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
elementOutput += "ELEMENT IS SYMBOL INSTANCE!";
|
|
|
|
elementOutput += "\n\tSYMBOL NAME: " + e.SI.SN;
|
|
|
|
}
|
|
|
|
|
|
|
|
trace(elementOutput);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
super.update(elapsed);
|
2021-08-19 18:53:18 +00:00
|
|
|
}
|
|
|
|
}
|