设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 4580|回复: 0
打印 上一主题 下一主题

[原创发布] 镜像动画修复

[复制链接]

Lv1.梦旅人

Mr.Gandum

梦石
0
星屑
226
在线时间
2070 小时
注册时间
2007-1-31
帖子
3039

贵宾

跳转到指定楼层
1
发表于 2016-1-27 23:54:06 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
默认镜像动画算法奇葩,导致使用旋转的动画会出现异常,现上插件修复:
JAVASCRIPT 代码复制下载
  1. //=============================================================================
  2. // Fix Mirrored Animation
  3. // MirrorAnimationFix.js
  4. // Version: 1.00
  5. //=============================================================================
  6. var Imported = Imported || {};
  7. Imported.Kien_MirrorAnimationFix = true;
  8.  
  9. var Kien = Kien || {};
  10. Kien.MirroredAnimation = {};
  11. //=============================================================================
  12. /*:
  13.  * @plugindesc Fix A bug that animatio will show wrong when used mirror in script.
  14.  * @author Kien
  15.  *
  16.  */
  17.  
  18. Kien.MirroredAnimation.Sprite_Animation_setup = Sprite_Animation.prototype.setup;
  19. Sprite_Animation.prototype.setup = function(target, animation, mirror, delay) {
  20.     Kien.MirroredAnimation.Sprite_Animation_setup.apply(this,arguments);
  21.     if (this._animation && this._mirror){
  22.         this.scale.x = -1;
  23.     }
  24. };
  25.  
  26. Sprite_Animation.prototype.updateCellSprite = function(sprite, cell) {
  27.     var pattern = cell[0];
  28.     if (pattern >= 0) {
  29.         var sx = pattern % 5 * 192;
  30.         var sy = Math.floor(pattern % 100 / 5) * 192;
  31.         var mirror = this._mirror;
  32.         sprite.bitmap = pattern < 100 ? this._bitmap1 : this._bitmap2;
  33.         sprite.setFrame(sx, sy, 192, 192);
  34.         sprite.x = cell[1];
  35.         sprite.y = cell[2];
  36.         sprite.rotation = cell[4] * Math.PI / 180;
  37.         sprite.scale.x = cell[3] / 100;
  38.         if (cell[5]) {
  39.             sprite.scale.x *= -1;
  40.         }
  41.         sprite.scale.y = cell[3] / 100;
  42.         sprite.opacity = cell[6];
  43.         sprite.blendMode = cell[7];
  44.         sprite.visible = this._target.visible;
  45.     } else {
  46.         sprite.visible = false;
  47.     }
  48. };

点评

感谢版主/w\  发表于 2016-2-17 21:50
汗有个没见过的按钮按下了改不了标签了囧  发表于 2016-2-12 13:54

评分

参与人数 1梦石 +1 收起 理由
余烬之中 + 1 精品文章

查看全部评分

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-5-16 06:40

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表