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

Project1

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

[有事请教] 关于官方插件LoopAnim.js, 如何可以改变动画的大小呢?

[复制链接]

Lv4.逐梦者

梦石
0
星屑
7028
在线时间
1359 小时
注册时间
2018-12-16
帖子
1939
跳转到指定楼层
1
发表于 2019-12-27 22:04:00 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
关于官方插件LoopAnim.js, 如何可以改变动画的大小呢?

看来看去都不知道要改哪里..... 请各位大神帮帮忙!

* Plugin Command:
*   LoopAnim start event animid   # Start a looping animation on an event
*   LoopAnim stop event           # Stop animation loop
*
*   event = number for specific event
*   event = 0 for "this" event
*   event = -1 for player
*   event = $gameVariables.value(x) to get the event id from variable x

---------------------------------------------------------------


原始碼:
----------------------------------------------------------------

//=============================================================================
// Looping Animations
// by Shaz
// Last Updated: 2015.09.21
//=============================================================================

/*:
* @plugindesc Allows animations on the map to loop
* @author Shaz
*
* @help
*
* Plugin Command:
*   LoopAnim start event animid   # Start a looping animation on an event
*   LoopAnim stop event           # Stop animation loop
*
*   event = number for specific event
*   event = 0 for "this" event
*   event = -1 for player
*   event = $gameVariables.value(x) to get the event id from variable x
*/

/*:ja
* @plugindesc ?????柴??潦?扼?怒???航?怒??整???
* @author Shaz
*
* @help
*
* Plugin Command:
*   LoopAnim start event animid   #
*         ?扎??喋?銝?柴??潦?扼?怒??????€?
*   LoopAnim stop event           #
*         ?U??~?瑯?喋?潦???甇U??整???
*
*   event = 0 ???柴???
*   event = -1 ???研?扎
*   event = $gameVariables.value(x) ????扎??喋?ID??敺?
*/

(function() {
  var _Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;
  Game_Interpreter.prototype.pluginCommand = function(command, args) {
    _Game_Interpreter_pluginCommand.call(this, command, args);

    if (command.toUpperCase() === 'LOOPANIM') {
      var character = this.character(eval(args[1]));
      if (character) {
        switch (args[0].toUpperCase()) {
          case 'START':
            character.loopAnimStart(args[2]);
            break;
          case 'STOP':
            character.loopAnimStop();
        }
      }
    }
  }

  var _Game_CharacterBase_initMembers = Game_CharacterBase.prototype.initMembers;
  Game_CharacterBase.prototype.initMembers = function() {
    _Game_CharacterBase_initMembers.call(this);
    this._loopAnimId = 0;
  };

  Game_CharacterBase.prototype.loopAnimStart = function(animId) {
    this._loopAnimId = animId;
    this.requestAnimation(animId);
  };

  Game_CharacterBase.prototype.loopAnimStop = function() {
    this._loopAnimId = 0;
  };

  Sprite_Character.prototype.isAnimationPlaying = function() {
    if (this._animationSprites.length > 0) {
      result = true;
    } else if (this._character._loopAnimId > 0) {
      this._character.requestAnimation(this._character._loopAnimId);
      this.setupAnimation();
      result = true;
    } else {
      result = false;
    };
    return result;
  };
})();

Lv4.逐梦者

梦石
0
星屑
7417
在线时间
947 小时
注册时间
2017-9-27
帖子
583
2
发表于 2019-12-28 18:54:58 | 只看该作者
插件里如果没有相关设置,那就需要你自己修改数据库里的动画了。
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
15507
在线时间
3950 小时
注册时间
2015-9-14
帖子
1333

开拓者

3
发表于 2019-12-29 01:17:26 | 只看该作者
本帖最后由 wabcmcc 于 2019-12-31 01:41 编辑

插件更新Looping AnimationsRM官方論壇
增加功能在角色精靈後面播放動畫.
沒有改變動畫的大小功能.

動畫的動態縮放.
作者:triacontane AnimationExtend.js

  1. //=============================================================================
  2. // Looping Animations
  3. // by Shaz
  4. // Last Updated: 2015.10.30
  5. //
  6. // Revisions:
  7. // 2015.10.30 Allow animations to play below/behind character
  8. //=============================================================================

  9. /*:
  10. * @plugindesc Allows animations on the map to loop
  11. * Also allows animations (normal or looping) to play below/behind characters
  12. * @author Shaz
  13. *
  14. * @help
  15. *
  16. * Plugin Command:
  17. *   LoopAnim start event animid   # Start a looping animation on an event
  18. *   LoopAnim stop event           # Stop animation loop
  19. *
  20. *   SetAnimLoc event location     # Set location of animation
  21. *
  22. *   event = number for specific event
  23. *   event = 0 for "this" event
  24. *   event = -1 for player
  25. *   event = $gameVariables.value(x) to get the event id from variable x
  26. *
  27. *   location = below or behind - play animation behind character sprite
  28. *   location = above or front - play animation in front of character sprite
  29. *              default is to play animation in front of character sprite
  30. */

  31. (function() {
  32.   var _Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;
  33.   Game_Interpreter.prototype.pluginCommand = function(command, args) {
  34.     _Game_Interpreter_pluginCommand.call(this, command, args);

  35.     if (command.toUpperCase() === 'LOOPANIM') {
  36.       var character = this.character(eval(args[1]));
  37.       if (character) {
  38.         switch (args[0].toUpperCase()) {
  39.           case 'START':
  40.             character.loopAnimStart(args[2]);
  41.             break;
  42.           case 'STOP':
  43.             character.loopAnimStop();
  44.         }
  45.       }
  46.     }

  47.     if (command.toUpperCase() === 'SETANIMLOC') {
  48.       var character = this.character(eval(args[0]));
  49.       if (character) {
  50.         character.setAnimLoc(args[1] || 'above');
  51.       }
  52.     }
  53.   }

  54.   var _Game_CharacterBase_initMembers = Game_CharacterBase.prototype.initMembers;
  55.   Game_CharacterBase.prototype.initMembers = function() {
  56.     _Game_CharacterBase_initMembers.call(this);
  57.     this._loopAnimId = 0;
  58.     this._animZ = 8;
  59.   };

  60.   Game_CharacterBase.prototype.loopAnimStart = function(animId) {
  61.     this._loopAnimId = animId;
  62.     this.requestAnimation(animId);
  63.   };

  64.   Game_CharacterBase.prototype.loopAnimStop = function() {
  65.     this._loopAnimId = 0;
  66.   };

  67.   Game_CharacterBase.prototype.setAnimLoc = function(location) {
  68.     switch (location.toUpperCase()) {
  69.       case 'BELOW':
  70.       case 'BEHIND':
  71.         this._animZ = 0;
  72.         break;
  73.       default:
  74.         this._animZ = 8;
  75.     }
  76.   }

  77.   Game_CharacterBase.prototype.animZ = function() {
  78.     return this._animZ;
  79.   }

  80.   Sprite_Character.prototype.isAnimationPlaying = function() {
  81.     if (this._animationSprites.length > 0) {
  82.       result = true;
  83.     } else if (this._character._loopAnimId > 0) {
  84.       this._character.requestAnimation(this._character._loopAnimId);
  85.       this.setupAnimation();
  86.       this._animationSprites[this._animationSprites.length - 1].z = this._character.animZ();
  87.       result = true;
  88.     } else {
  89.       result = false;
  90.     };
  91.     return result;
  92.   };
  93. })();
复制代码

点评

^_____^  发表于 2020-1-11 15:31
記憶回來  发表于 2019-12-31 01:42
可以搜尋一下大大的記憶嗎? 感謝  发表于 2019-12-29 14:08
記憶上好像有.  发表于 2019-12-29 11:51
有類似功能然後可以改動畫大小的嗎?  发表于 2019-12-29 05:08
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-24 05:13

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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