| 本帖最后由 汪汪 于 2016-1-2 20:14 编辑 
 aaaassss123 发表于 2016-1-2 20:02 ![]() 其实不是指这个,指的是人物本身战斗动画,我用的是横版战斗,现在默认是3帧的,我想扩展出去。 ...
 应该是这里 ,结合战斗动作图修改就好
 
 
 
 //这里是处理帧在图的位置的Sprite_Actor.prototype.updateFrame = function() {    Sprite_Battler.prototype.updateFrame.call(this);    var bitmap = this._mainSprite.bitmap;    if (bitmap) {        var motionIndex = this._motion ? this._motion.index : 0;        var pattern = this._pattern < 3 ? this._pattern : 1;        var cw = bitmap.width / 9;        var ch = bitmap.height / 6;        var cx = Math.floor(motionIndex / 6) * 3 + pattern;        var cy = motionIndex % 6;        this._mainSprite.setFrame(cx * cw, cy * ch, cw, ch);    }};//更新动作计数                   和这里处理帧的计数的Sprite_Actor.prototype.updateMotionCount = function() {    if (this._motion && ++this._motionCount >= this.motionSpeed()) {        if (this._motion.loop) {            this._pattern = (this._pattern + 1) % 4;        } else if (this._pattern < 2) {            this._pattern++;        } else {            this.refreshMotion();        }        this._motionCount = 0;    }};
//这里是处理帧在图的位置的 
Sprite_Actor.prototype.updateFrame = function() { 
    Sprite_Battler.prototype.updateFrame.call(this); 
    var bitmap = this._mainSprite.bitmap; 
    if (bitmap) { 
        var motionIndex = this._motion ? this._motion.index : 0; 
        var pattern = this._pattern < 3 ? this._pattern : 1; 
        var cw = bitmap.width / 9; 
        var ch = bitmap.height / 6; 
        var cx = Math.floor(motionIndex / 6) * 3 + pattern; 
        var cy = motionIndex % 6; 
        this._mainSprite.setFrame(cx * cw, cy * ch, cw, ch); 
    } 
}; 
//更新动作计数                   和这里处理帧的计数的 
Sprite_Actor.prototype.updateMotionCount = function() { 
    if (this._motion && ++this._motionCount >= this.motionSpeed()) { 
        if (this._motion.loop) { 
            this._pattern = (this._pattern + 1) % 4; 
        } else if (this._pattern < 2) { 
            this._pattern++; 
        } else { 
            this.refreshMotion(); 
        } 
        this._motionCount = 0; 
    } 
}; 
 |