Project1

标题: 关于官方插件LoopAnim.js, 如何可以改变动画的大小呢? [打印本页]

作者: play337    时间: 2019-12-27 22:04
标题: 关于官方插件LoopAnim.js, 如何可以改变动画的大小呢?
关于官方插件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;
  };
})();

作者: 梦想家大魔王    时间: 2019-12-28 18:54
插件里如果没有相关设置,那就需要你自己修改数据库里的动画了。
作者: wabcmcc    时间: 2019-12-29 01:17
本帖最后由 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. })();
复制代码






欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1