Hi all,
I have a texture atlas (created with TexturePacker) with several animations.
I would like to take one of these animations, center it and flip on x axis
But when flip it on x axis ,it seems that the pivot has changed position is no longer in the center
public function addAnimation(name:String, frames:Array<Tile>, ?flipX:Bool, ?fps:Int) {
var clone = frames;
for (i in 0...clone.length) {
clone[i].center();
flipX ? clone[i].flipX() : null;
}
this.frames.set(name, clone);
}
I found the solution, i only need save center tile reference
public function addAnimation(name:String, frames:Array<Tile>, ?flipX:Bool, ?fps:Int) {
var clone = frames;
for (i in 0...clone.length) {
clone[i] = clone[i].center();
flipX ? clone[i].flipX() : null;
}
this.frames.set(name, clone);
}