zombie-party/www/js/plugins/InfoWindow.js
2023-10-10 14:05:48 -05:00

75 lines
No EOL
2.1 KiB
JavaScript

//=============================================================================
// InfoWindow.js
//=============================================================================
/*:
* @plugindesc 情報表示ウィンドウをメニュー画面に追加するプラグイン
* @author Me
*
* @help 情報表示ウィンドウをメニュー画面上に追加します。
*
*/
(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_Base.prototype);
Window_Info.prototype.constructor = Window_Info;
Window_Info.prototype.initialize = function () {
var x = 20;
var y = 20;
var width = 180;
var height = 108;
Window_Base.prototype.initialize.call(this, x, y, width, height);
};
Window_Info.prototype.setText = function (str) {
this._text = str;
this.refresh();
};
// ウィンドウに載せる内容
Window_Info.prototype.refresh = function () {
this.contents.clear();
this.changeTextColor(this.textColor(16));
this.drawIcon(210, 1, 1);
this.drawText("拾った宝箱", 40, 1);
this.resetTextColor();
this.drawText($gameVariables.value(2) + " 個", 0, this.lineHeight());
};
// フォントサイズ
Window_Info.prototype.standardFontSize = function () {
return 20;
};
// ウィンドウの透明度
Window_Info.prototype.standardBackOpacity = function () {
return 255;
};
// ウィンドウの余白
Window_Info.prototype.standardPadding = function () {
return 18;
};
// ウィンドウの色調
Window_Info.prototype.updateTone = function () {
this.setTone(64, 0, 128);
};
})();