Project1
标题:
有没有修改道具说明内容的方法?
[打印本页]
作者:
雷影
时间:
2023-10-7 09:57
标题:
有没有修改道具说明内容的方法?
就是拿到一个关键道具,随着游戏进度进程,逐渐变化说明栏里的信息!
比如拿到一个七星盘之类的道具,需要点亮七颗星星,每点亮一颗,说明栏里就增加一个☆,直到达成☆☆☆☆☆☆☆ 7个星星。
当然最笨的办法是设计8个相同的道具对应0-7星,道具一样说明不同而已。只不过觉得有点浪费资源,记得好像有代码可以更换说明的。
作者:
余杭
时间:
2023-10-7 10:40
你可以用变量写⭐⭐,然后说明里面放变量
作者:
小秋橙
时间:
2023-10-7 17:36
//-----------------------------------------------------------------------------
// Window_Help
// rpg_windows.js第1470行,可以修改下面的这些函数来更改帮助窗口的文字
// 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);
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(), 0);
};
复制代码
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1