设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 3198|回复: 3
打印 上一主题 下一主题

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

[复制链接]

Lv2.观梦者

梦石
0
星屑
260
在线时间
312 小时
注册时间
2010-8-2
帖子
355
跳转到指定楼层
1
发表于 2019-11-13 23:54:44 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
JAVASCRIPT 代码复制
  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. /**绘制状态图标 */
  14. Window_Base.prototype._drawActorIcons = function(actor, x, y, width,w,h) {
  15.     width = width || 144;
  16.     var $icons = actor.allIcons().slice(0, Math.floor(width / Window_Base._iconWidth));
  17.     for (var i = 0; i < icons.length; i++) {
  18.         this._drawIcon(icons[i], x + Window_Base._iconWidth * i, y,w,h);
  19.     }
  20. };
  21. /*
  22.  
  23. 窗口处理模块
  24.  */
  25. map_statu.prototype.update = function() {
  26.     Window.prototype.update.call(this);
  27.    var actor = $gameActors.actor(1);
  28.     this.updateTone();
  29.     this.updateOpen();
  30.     this.updateClose();
  31.     this.updateBackgroundDimmer();
  32.     //this.drawActorFace($gameActors.actor(1), 0, 0, 100, 100);
  33.     this._drawFace(actor.faceName(), actor.faceIndex(), 0, 0, 144, 144,50,50);
  34.     this._drawActorHp($gameActors.actor(1),50,0,150);
  35.     this._drawActorMp($gameActors.actor(1),50,30,150);
  36.     this._drawActorName($gameActors.actor(1),0,60);
  37.     this._drawActorIcons(actor,55,50,144,18,18);
  38. };

map_statu是window_base的子类,我把绘制状态的方法重写了一下,然后放到update里边,为什么增加状态时候能直接显示,而移除状态时候就不能
移除状态时候得切一下菜单,然后切回来,那个移除的状态才会消失
之前发的那些帖子里的言语特别幼稚,当时自己还小,什么都不懂,希望大家不要介意...现在看之前自己的帖子都特别生气觉得特别傻
                                                      ---2017.09.02留

Lv2.观梦者

梦石
0
星屑
811
在线时间
117 小时
注册时间
2018-8-25
帖子
95
2
发表于 2019-11-14 01:29:05 | 只看该作者
大概是刷新时间点问题
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
260
在线时间
312 小时
注册时间
2010-8-2
帖子
355
3
 楼主| 发表于 2019-11-14 12:26:56 | 只看该作者
2669483303 发表于 2019-11-14 01:29
大概是刷新时间点问题

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

使用道具 举报

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

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-4-27 23:18

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表