BBB 发表于 2016-1-22 13:50
Window_Base.prototype.drawText = function(text, x, y, maxWidth, align) {
this.contents.drawText( ...
具体如何使用,我直接当插件用,效果比较混乱! 说明窗口文件也没居中
修改, Window_Base 和 Window_Help 也没效果
能直接修改 Window_Help的插件吗?
//----------------------------------------------------------------------------- // Window_Help // // The window for displaying the description of the selected item. function Window_Help() { this.initialize.apply(this, arguments); } Window_Help.prototype = Object.create(Window_Base.prototype); Window_Help.prototype.constructor = Window_Help; Window_Help.prototype.initialize = function(numLines) { var width = Graphics.boxWidth; var height = this.fittingHeight(numLines || 2); Window_Base.prototype.initialize.call(this, 0, 0, width, height,'center'); this._text = ''; }; Window_Help.prototype.setText = function(text) { if (this._text !== text) { this._text = text; this.refresh(); } }; Window_Help.prototype.clear = function() { this.setText(''); }; Window_Help.prototype.setItem = function(item) { this.setText(item ? item.description : ''); }; Window_Help.prototype.refresh = function() { this.contents.clear(); this.drawTextEx(this._text, this.textPadding(), 1); };
//-----------------------------------------------------------------------------
// Window_Help
//
// The window for displaying the description of the selected item.
function Window_Help() {
this.initialize.apply(this, arguments);
}
Window_Help.prototype = Object.create(Window_Base.prototype);
Window_Help.prototype.constructor = Window_Help;
Window_Help.prototype.initialize = function(numLines) {
var width = Graphics.boxWidth;
var height = this.fittingHeight(numLines || 2);
Window_Base.prototype.initialize.call(this, 0, 0, width, height,'center');
this._text = '';
};
Window_Help.prototype.setText = function(text) {
if (this._text !== text) {
this._text = text;
this.refresh();
}
};
Window_Help.prototype.clear = function() {
this.setText('');
};
Window_Help.prototype.setItem = function(item) {
this.setText(item ? item.description : '');
};
Window_Help.prototype.refresh = function() {
this.contents.clear();
this.drawTextEx(this._text, this.textPadding(), 1);
};
|