查看: 4046|回复: 3

[有事请教] 插件编写问题求教

[复制链接]
梦石
0
星屑
272
在线时间
313 小时
注册时间
2010-8-2
回帖
290
发表于 2019-11-13 23:54:44 | 显示全部楼层 |阅读模式

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

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

×
  1. /*
  2. 图标重绘
  3. */
  4. Window_Base.prototype._drawIcon = function(iconIndex, x, y,w,h) {
  5.     var bitmap = ImageManager.loadSystem('IconSet');
  6.     var pw = Window_Base._iconWidth;
  7.     var ph = Window_Base._iconHeight;
  8.     var sx = iconIndex % 16 * pw;
  9.     var sy = Math.floor(iconIndex / 16) * ph;
  10.     this.contents.blt(bitmap, sx, sy, pw, ph, x, y,w,h);
  11. };

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

  21. 窗口处理模块
  22. */
  23. map_statu.prototype.update = function() {
  24.     Window.prototype.update.call(this);
  25.    var actor = $gameActors.actor(1);
  26.     this.updateTone();
  27.     this.updateOpen();
  28.     this.updateClose();
  29.     this.updateBackgroundDimmer();
  30.     //this.drawActorFace($gameActors.actor(1), 0, 0, 100, 100);
  31.     this._drawFace(actor.faceName(), actor.faceIndex(), 0, 0, 144, 144,50,50);
  32.     this._drawActorHp($gameActors.actor(1),50,0,150);
  33.     this._drawActorMp($gameActors.actor(1),50,30,150);
  34.     this._drawActorName($gameActors.actor(1),0,60);
  35.     this._drawActorIcons(actor,55,50,144,18,18);
  36. };
复制代码

map_statu是window_base的子类,我把绘制状态的方法重写了一下,然后放到update里边,为什么增加状态时候能直接显示,而移除状态时候就不能
移除状态时候得切一下菜单,然后切回来,那个移除的状态才会消失
之前发的那些帖子里的言语特别幼稚,当时自己还小,什么都不懂,希望大家不要介意...现在看之前自己的帖子都特别生气觉得特别傻
                                                      ---2017.09.02留
梦石
0
星屑
883
在线时间
123 小时
注册时间
2018-8-25
回帖
93
发表于 2019-11-14 01:29:05 | 显示全部楼层
大概是刷新时间点问题
回复

使用道具 举报

梦石
0
星屑
272
在线时间
313 小时
注册时间
2010-8-2
回帖
290
 楼主| 发表于 2019-11-14 12:26:56 | 显示全部楼层
2669483303 发表于 2019-11-14 01:29
大概是刷新时间点问题

解决了 我在刷新里加了clear就好了
之前发的那些帖子里的言语特别幼稚,当时自己还小,什么都不懂,希望大家不要介意...现在看之前自己的帖子都特别生气觉得特别傻
                                                      ---2017.09.02留
回复

使用道具 举报

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

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部