加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 RPG6666666666 于 2017-2-2 20:44 编辑
最近在做个游戏,需要问大神关于读档的问题!求大神解答:
我自己修改rpg_window.js里的代码,拿drawActorFace方法出来另写了个显示大脸的方法
但是我修改完,效果出来了,点击保存,此时图片什么的都是加载过的,所以打开菜单可以看到图片
但我退出游戏,重新打开游戏进行测试,用户此时肯定是点击“读档”进行上次的游戏,但是此时点开菜单,却没加载人脸图?(已经被我修改成两倍尺寸的大脸)
然后关闭菜单界面,再次打开菜单,从此就出来了。。。
求大神指点,为什么刚读档的时候进菜单就不加载?退出菜单重进菜单就加载了?
我少了什么代码?或者是我打错什么代码了?
代码:
Window_MenuStatus.prototype.drawMenuActorFace = function(actor, index) { this.drawMenuFace(actor.faceName(), index); }; Window_MenuStatus.prototype.drawMenuFace = function(faceName, index) { var bitmap = ImageManager.loadFace(faceName + index); // + '_big' 自己加的后缀 var actor = $gameParty.members()[index]; var rect = this.itemRectForText(index); var w = Math.min(rect.width, 250); var h = Math.min(rect.height, 430); var lineHeight = this.lineHeight(); var sx = (bitmap.width > w) ? (bitmap.width - w) / 2 : 0; var sy = (bitmap.height > h) ? (bitmap.height - h) / 2 : 0; var dx = (bitmap.width > rect.width) ? rect.x : rect.x + (rect.width - bitmap.width) / 2; var dy = (bitmap.height > rect.height) ? rect.y : rect.y + (rect.height - bitmap.height) / 2; this.contents.blt(bitmap, sx, sy, w, h, dx, dy); };
Window_MenuStatus.prototype.drawMenuActorFace = function(actor, index) {
this.drawMenuFace(actor.faceName(), index);
};
Window_MenuStatus.prototype.drawMenuFace = function(faceName, index) {
var bitmap = ImageManager.loadFace(faceName + index); // + '_big' 自己加的后缀
var actor = $gameParty.members()[index];
var rect = this.itemRectForText(index);
var w = Math.min(rect.width, 250);
var h = Math.min(rect.height, 430);
var lineHeight = this.lineHeight();
var sx = (bitmap.width > w) ? (bitmap.width - w) / 2 : 0;
var sy = (bitmap.height > h) ? (bitmap.height - h) / 2 : 0;
var dx = (bitmap.width > rect.width) ? rect.x : rect.x + (rect.width - bitmap.width) / 2;
var dy = (bitmap.height > rect.height) ? rect.y : rect.y + (rect.height - bitmap.height) / 2;
this.contents.blt(bitmap, sx, sy, w, h, dx, dy);
};
调用:
Window_MenuStatus.prototype.drawItemImage = function(index) { var actor = $gameParty.members()[index]; var rect = this.itemRect(index); this.changePaintOpacity(actor.isBattleMember()); // this.drawMenuActorFace(actor, index); // 上面这句因为我用了AltMenuScreen3.js,所以挂在AltMenuScreen3.js上的drawItemStatus调用了 this.changePaintOpacity(true); };
Window_MenuStatus.prototype.drawItemImage = function(index) {
var actor = $gameParty.members()[index];
var rect = this.itemRect(index);
this.changePaintOpacity(actor.isBattleMember());
// this.drawMenuActorFace(actor, index);
// 上面这句因为我用了AltMenuScreen3.js,所以挂在AltMenuScreen3.js上的drawItemStatus调用了
this.changePaintOpacity(true);
};
|