| 赞 | 664 |
| VIP | |
| 好人卡 | |
| 积分 | 345 |
| 经验 | |
| 最后登录 | 2024-7-10 |
| 在线时间 | 5096 小时 |
- 梦石
- 0
- 星屑
- 34465
- 在线时间
- 5096 小时
- 注册时间
- 2012-11-19
- 回帖
- 4715

|
发表于 2020-7-26 08:21:21
|
显示全部楼层
本帖最后由 芯☆淡茹水 于 2020-7-26 09:18 编辑
Window_BattleLog 进程会等待动画的播放结束,也就是你所说的 卡住 。
如果你有循环动画功能的话,可以尝试把对象播放循环动画时的 isAnimationPlaying 改成 false 。
以前就预先 pia 了个循环动画,但是只有基本功能,至于谁播放循环动画,什么时候播放,什么时候停止,,,
这些只有根据实际使用情况自己编写。
[pre lang="javascript"]//=================================================================================================
// Loop_Animation.js
//=================================================================================================
/*:
* @plugindesc 循环动画。
* @author 芯☆淡茹水
* @help
*
* Sprite_Base 以及其子类,皆可以播放循环动画,以下代称为 objSprite 。
*
* 开始循环动画: objSprite.startLoopAnimation(animationId, mirror, delay);
* animationId :动画ID。
* mirror :是否镜像。
* delay :延迟帧数。
*
* 停止循环动画: objSprite.stopLoopAnimation(animationId);
*
* 是否正在播放某个循环动画: objSprite.isLoopAnimationPlaying(animationId);
*
*/
//=================================================================================================
;(function(){
//=================================================================================================
var Sprite_Base_initialize = Sprite_Base.prototype.initialize;
Sprite_Base.prototype.initialize = function() {
Sprite_Base_initialize.call(this);
this._loopAnimationSprites = [];
};
Sprite_Base.prototype.startLoopAnimation = function(animationId, mirror, delay) {
if (!$dataAnimations[animationId] || this.isLoopAnimationPlaying(animationId)) return;
var sprite = new Sprite_LoopAnimation();
sprite.setup(this._effectTarget, animationId, mirror, delay);
this.parent.addChild(sprite);
this._loopAnimationSprites.push(sprite);
};
Sprite_Base.prototype.stopLoopAnimation = function(animationId) {
var anmSprite = this._loopAnimationSprites.filter(function(sprite){
return sprite.id() === animationId;
}).shift();
if (anmSprite) {
var index = this._loopAnimationSprites.indexOf(anmSprite);
anmSprite.remove();
this._loopAnimationSprites.splice(index, 1);
}
};
Sprite_Base.prototype.isLoopAnimationPlaying = function(animationId) {
return this._loopAnimationSprites.some(function(anmSprite){
return anmSprite.id() === animationId;
});
};
//=================================================================================================
function Sprite_LoopAnimation() {
this.initialize.apply(this, arguments);
}
Sprite_LoopAnimation.prototype = Object.create(Sprite_Animation.prototype);
Sprite_LoopAnimation.prototype.constructor = Sprite_LoopAnimation;
Sprite_LoopAnimation.prototype.id = function() {
return this._animationId;
};
Sprite_LoopAnimation.prototype.setup = function(target, animationId, mirror, delay) {
this._animationId = animationId;
var animation = $dataAnimations[animationId];
Sprite_Animation.prototype.setup.call(this, target, animation, mirror, delay);
};
Sprite_LoopAnimation.prototype.isPlaying = function() {
return true;
};
Sprite_LoopAnimation.prototype.updateMain = function() {
if (this._duration <= 0) {
this._target.setBlendColor([0, 0, 0, 0]);
this._target.show();
this.setupDuration();
} else Sprite_Animation.prototype.updateMain.call(this);
};
//=================================================================================================
}()); // end
//=================================================================================================[/pre] |
|