Skip to content

Commit 4179d69

Browse files
author
liply
authored
Merge pull request #37 from rpgtkoolmv/fix-mirror
flip mirrored animation by Y Axis
2 parents 905e8ae + 5704cd7 commit 4179d69

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

js/rpg_sprites/Sprite_Animation.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -250,14 +250,18 @@ Sprite_Animation.prototype.updateCellSprite = function(sprite, cell) {
250250
sprite.setFrame(sx, sy, 192, 192);
251251
sprite.x = cell[1];
252252
sprite.y = cell[2];
253-
if (this._mirror) {
254-
sprite.x *= -1;
255-
}
256253
sprite.rotation = cell[4] * Math.PI / 180;
257254
sprite.scale.x = cell[3] / 100;
258-
if ((cell[5] && !mirror) || (!cell[5] && mirror)) {
255+
256+
if(cell[5]){
259257
sprite.scale.x *= -1;
260258
}
259+
if(mirror){
260+
sprite.x *= -1;
261+
sprite.rotation *= -1;
262+
sprite.scale.x *= -1;
263+
}
264+
261265
sprite.scale.y = cell[3] / 100;
262266
sprite.opacity = cell[6];
263267
sprite.blendMode = cell[7];

0 commit comments

Comments
 (0)