コトノハさんのブログ記事をもとにrpg_windows.jsの5439行以降を抜粋しながら下のコードを作成してみたんですがいったい何がどうダメなのでしょうか?
おそらく何もかもがダメな気がするんですが解決方法も教えていただけるとありがたいです。
よろしくお願いします。
コード: 全て選択
(function() {
// マップ上にウィンドウ表示するよ宣言
var Scene_map_start = Scene_Map.prototype.start;
Scene_Map.prototype.start = function() {
Scene_map_start.call(this);
this._InfoWindow = new Window_Info();
this.addWindow(this._InfoWindow);
};
var _Scene_Map_update = Scene_Map.prototype.update;
Scene_Map.prototype.update = function() {
_Scene_Map_update.call(this);
this._InfoWindow.setText();
};
// ここからメニューウィンドウ作り始まります。
function Window_Info() {
this.initialize.apply(this, arguments);
}
Window_Info.prototype = Object.create(Window_Selectable.prototype);
Window_Info.prototype.constructor = Window_Info;
Window_Info.prototype.initialize = function() {
var width = this.windowWidth();
var height = this.windowHeight();
var x = Graphics.boxWidth - width;
var y = Graphics.boxHeight - height;
Window_Selectable.prototype.initialize.call(this, x, y, width, height);
this.refresh();
this.openness = 0;
};
// ウィンドウに載せる内容
Window_Info.prototype.refresh = function() {
this.contents.clear();
this.changeTextColor(this.textColor(16));
this.drawIcon(210, 1, 1);
this.drawActorName(actor, rect.x + 0, rect.y, 150);
this.drawActorIcons(actor, rect.x + 156, rect.y, rect.width - 156);
this.drawActorHp(actor, rect.x + 0, rect.y, 108);
this.drawActorMp(actor, rect.x + 123, rect.y, 96);
this.drawActorTp(actor, rect.x + 234, rect.y, 96);