How do you add multiple different images into 1 animation? #2510
-
I am trying to make a game, but I have encountered a problem where I need 2 different .png files to be in one animation, but I can't figure out how to do it. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
I recommend using a spritesheet instead of multiple images, when possible |
Beta Was this translation helpful? Give feedback.
-
I answered this on the Haxe's discord server, but the worst answer that I can give is this: var bitmap = Assets.getBitmapData(Path1);
var bitmap2 = Assets.getBitmapData(Path2);
// max is a function I use for comparing ints, but basically it's `return a < b ? b : a;`
var bitmapDraw = new BitmapData(max(bitmap.width, bitmap2.width), bitmap.height + bitmap2.height, true, 0x00000000);
bitmapDraw.draw(bitmap);
bitmapDraw.draw(bitmap2, new FlxMatrix(1,0,0,1, 0, bitmap.height));
bitmap = bitmapDraw; I don't think it's the best solution but it's one of them. |
Beta Was this translation helpful? Give feedback.
I answered this on the Haxe's discord server, but the worst answer that I can give is this:
I don't think it's the best solution b…