查看: 1174|回复: 4

[有事请教] 有没有修改道具说明内容的方法?

[复制链接]
梦石
0
星屑
8201
在线时间
1331 小时
注册时间
2006-7-18
回帖
460
发表于 2023-10-7 09:57:25 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
就是拿到一个关键道具,随着游戏进度进程,逐渐变化说明栏里的信息!
比如拿到一个七星盘之类的道具,需要点亮七颗星星,每点亮一颗,说明栏里就增加一个☆,直到达成☆☆☆☆☆☆☆ 7个星星。
当然最笨的办法是设计8个相同的道具对应0-7星,道具一样说明不同而已。只不过觉得有点浪费资源,记得好像有代码可以更换说明的。
梦石
0
星屑
5487
在线时间
712 小时
注册时间
2022-11-26
回帖
296
发表于 2023-10-7 10:40:01 | 显示全部楼层
你可以用变量写⭐⭐,然后说明里面放变量

点评

找到了$gameVariables.setValue(n, val) 对n号变量赋予val值 ,n是变量ID,val是要赋予的值,赋予文字时加上 '单引号' 而$gameVariables.value(n) 是取得n号变量的值  发表于 2023-10-7 20:19
怎么在变量里赋予文本文字啊?  发表于 2023-10-7 19:29
回复 1 0

使用道具 举报

梦石
2
星屑
8479
在线时间
463 小时
注册时间
2021-12-4
回帖
486

MZ评测员

发表于 2023-10-7 17:36:03 | 显示全部楼层
  1. //-----------------------------------------------------------------------------
  2. // Window_Help
  3. // rpg_windows.js第1470行,可以修改下面的这些函数来更改帮助窗口的文字
  4. // The window for displaying the description of the selected item.

  5. function Window_Help() {
  6.     this.initialize.apply(this, arguments);
  7. }

  8. Window_Help.prototype = Object.create(Window_Base.prototype);
  9. Window_Help.prototype.constructor = Window_Help;

  10. Window_Help.prototype.initialize = function(numLines) {
  11.     var width = Graphics.boxWidth;
  12.     var height = this.fittingHeight(numLines || 2);
  13.     Window_Base.prototype.initialize.call(this, 0, 0, width, height);
  14.     this._text = '';
  15. };

  16. Window_Help.prototype.setText = function(text) {
  17.     if (this._text !== text) {
  18.         this._text = text;
  19.         this.refresh();
  20.     }
  21. };

  22. Window_Help.prototype.clear = function() {
  23.     this.setText('');
  24. };

  25. Window_Help.prototype.setItem = function(item) {
  26.     this.setText(item ? item.description : '');
  27. };

  28. Window_Help.prototype.refresh = function() {
  29.     this.contents.clear();
  30.     this.drawTextEx(this._text, this.textPadding(), 0);
  31. };
复制代码
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部