Project1

标题: 插件编写问题求教 [打印本页]

作者: 759782518    时间: 2019-11-13 23:54
标题: 插件编写问题求教
[pre lang="javascript"]/*
图标重绘
*/
Window_Base.prototype._drawIcon = function(iconIndex, x, y,w,h) {
    var bitmap = ImageManager.loadSystem('IconSet');
    var pw = Window_Base._iconWidth;
    var ph = Window_Base._iconHeight;
    var sx = iconIndex % 16 * pw;
    var sy = Math.floor(iconIndex / 16) * ph;
    this.contents.blt(bitmap, sx, sy, pw, ph, x, y,w,h);
};

/**绘制状态图标 */
Window_Base.prototype._drawActorIcons = function(actor, x, y, width,w,h) {
    width = width || 144;
    var $icons = actor.allIcons().slice(0, Math.floor(width / Window_Base._iconWidth));
    for (var i = 0; i < icons.length; i++) {
        this._drawIcon(icons, x + Window_Base._iconWidth * i, y,w,h);
    }
};
/*

窗口处理模块
*/
map_statu.prototype.update = function() {
    Window.prototype.update.call(this);
   var actor = $gameActors.actor(1);
    this.updateTone();
    this.updateOpen();
    this.updateClose();
    this.updateBackgroundDimmer();
    //this.drawActorFace($gameActors.actor(1), 0, 0, 100, 100);
    this._drawFace(actor.faceName(), actor.faceIndex(), 0, 0, 144, 144,50,50);
    this._drawActorHp($gameActors.actor(1),50,0,150);
    this._drawActorMp($gameActors.actor(1),50,30,150);
    this._drawActorName($gameActors.actor(1),0,60);
    this._drawActorIcons(actor,55,50,144,18,18);
};[/pre]
map_statu是window_base的子类,我把绘制状态的方法重写了一下,然后放到update里边,为什么增加状态时候能直接显示,而移除状态时候就不能
移除状态时候得切一下菜单,然后切回来,那个移除的状态才会消失
作者: 2669483303    时间: 2019-11-14 01:29
大概是刷新时间点问题

作者: 759782518    时间: 2019-11-14 12:26
2669483303 发表于 2019-11-14 01:29
大概是刷新时间点问题

解决了 我在刷新里加了clear就好了




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