本帖最后由 tseyik 于 2018-3-7 10:13 编辑
http://ktnhmv.jugem.jp/?eid=21
看不看得明?
マップ上に常に情報ウィンドウを表示する(地圖上常駐窗口)
InfoWindow.zip
(1005 Bytes, 下载次数: 77)
以下是中文化
//============================================================================= // 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); }; })();
//=============================================================================
// 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);
};
})();
|