1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2024-11-23 15:26:06 +00:00

spritemap atlas bullshit?

This commit is contained in:
Cameron Taylor 2021-03-29 18:06:35 -07:00
parent f93def6df1
commit b388ea9064

View file

@ -1,11 +1,15 @@
package animate;
import flixel.FlxG;
import flixel.addons.ui.FlxUIColorSwatchSelecter.SwatchGraphic;
import flixel.graphics.FlxGraphic;
import flixel.graphics.frames.FlxAtlasFrames;
import flixel.math.FlxPoint;
import flixel.math.FlxRect;
import flixel.system.FlxAssets.FlxGraphicAsset;
import haxe.Json;
import openfl.Assets;
import openfl.geom.Rectangle;
class AnimationAtlas
{
@ -44,7 +48,14 @@ class AnimationAtlas
// probably nicer way to do this? Oh well
var swagSprite:AnimateSprite = sprite.SPRITE;
trace(swagSprite);
var rect = FlxRect.get(swagSprite.x, swagSprite.y, swagSprite.w, swagSprite.h);
var size = new Rectangle(0, 0, rect.width, rect.height);
var offset = FlxPoint.get(-size.left, -size.top);
var sourceSize = FlxPoint.get(size.width, size.height);
frames.addAtlasFrame(rect, sourceSize, offset, swagSprite.name);
}
return frames;