设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 912|回复: 5
打印 上一主题 下一主题

[有事请教] 求救!如何在地图上显示变量

[复制链接]

Lv2.观梦者

梦石
0
星屑
338
在线时间
97 小时
注册时间
2021-7-1
帖子
22
跳转到指定楼层
1
发表于 2023-5-5 23:28:29 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
100星屑
资源都会实时显示有多少的那种,比如石头,木头什么的数量都显示在游戏上方。求救大佬!!!

Lv3.寻梦者

梦石
0
星屑
3592
在线时间
578 小时
注册时间
2022-11-26
帖子
281
2
发表于 2023-5-5 23:37:35 | 只看该作者
抄一个地图金币框?
回复

使用道具 举报

Lv2.观梦者

梦石
0
星屑
338
在线时间
97 小时
注册时间
2021-7-1
帖子
22
3
 楼主| 发表于 2023-5-5 23:42:38 | 只看该作者
余杭 发表于 2023-5-5 23:37
抄一个地图金币框?

怎么搞呀
回复

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
4496
在线时间
109 小时
注册时间
2023-2-9
帖子
26
4
发表于 2023-5-6 06:22:44 | 只看该作者
推荐你去找下drill 大佬写的插件集合,里面就有个变量框显示的插件
定制立绘,定制行走图,定制CG,定制龙骨模型,live2d制作,简单产品的3D建模渲染,可联系qq1101340379。
十分擅长10-20岁的美少女绘制
新作-近代西方魔幻克系RPG《虚构未来》筹备制作中。
回复

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
5405
在线时间
386 小时
注册时间
2021-12-4
帖子
407
5
发表于 2023-5-6 16:50:37 | 只看该作者
MZ倒是有个很强的官方插件ExtraWindows.js,或许你应该找个大佬把它稍作修改改成MV能用的样子?
  1. //=============================================================================
  2. // RPG Maker MV - Extra Window Display Per Scene Plugin
  3. //=============================================================================
  4. // Version
  5. // 1.0.1 2021/05/22 開閉アニメーションを無効かつスイッチ条件で非表示になったウィンドウが一瞬だけ見えてしまう不具合を修正
  6. // 1.0.0 2020/08/20 初版
  7. //=============================================================================

  8. /*:
  9. * @target MV
  10. * @plugindesc Extra Window Display Per Scene Plugin
  11. * @author triacontane
  12. * @base PluginCommonBase
  13. * @orderAfter PluginCommonBase
  14. *
  15. * @param WindowList
  16. * @text Window List
  17. * @desc A list of windows to be added to all screens.
  18. * @default []
  19. * @type struct<Window>[]
  20. *
  21. * @help ExtraWindow.js
  22. *
  23. * Additional window displays can be used for scenes that have an optional window specified.
  24. * Basic information such as coordinates, font size, whether there's an open/close animation, etc. can be set.
  25. * Control characters can be used in the window display text, and when the return value is changed,
  26. * it will automatically be redrawn.
  27. *
  28. */

  29. /*~struct~Window:
  30. *
  31. * @param SceneName
  32. * @text Target Scene
  33. * @desc The scene to receive the extra window. When targeting an original scene, directly input the scene class name.
  34. * @type select
  35. * @default Scene_Title
  36. * @option Title
  37. * @value Scene_Title
  38. * @option Map
  39. * @value Scene_Map
  40. * @option Game Over
  41. * @value Scene_Gameover
  42. * @option Battle
  43. * @value Scene_Battle
  44. * @option Main Menu
  45. * @value Scene_Menu
  46. * @option Items
  47. * @value Scene_Item
  48. * @option Skills
  49. * @value Scene_Skill
  50. * @option Equipment
  51. * @value Scene_Equip
  52. * @option Status
  53. * @value Scene_Status
  54. * @option Options
  55. * @value Scene_Options
  56. * @option Save
  57. * @value Scene_Save
  58. * @option Load
  59. * @value Scene_Load
  60. * @option Game End
  61. * @value Scene_End
  62. * @option Shop
  63. * @value Scene_Shop
  64. * @option Name Input
  65. * @value Scene_Name
  66. * @option Debug
  67. * @value Scene_Debug
  68. *
  69. * @param x
  70. * @text X coordinate
  71. * @desc The X coordinate.
  72. * @default 0
  73. * @type number
  74. * @min -9999
  75. *
  76. * @param y
  77. * @text Y coordinate
  78. * @desc The Y coordinate.
  79. * @default 0
  80. * @type number
  81. * @min -9999
  82. *
  83. * @param width
  84. * @text Width
  85. * @desc The width.
  86. * @default 200
  87. * @type number
  88. *
  89. * @param height
  90. * @text Height.
  91. * @desc The height. Configured automatically when 0 is specified.
  92. * @default 0
  93. * @type number
  94. *
  95. * @param LineHeight
  96. * @text Line Height
  97. * @desc Height per line.
  98. * @default 36
  99. * @type number
  100. *
  101. * @param Text
  102. * @text Displayed Text
  103. * @desc Content to be displayed in the window. If a return value that serves as the basis for a control character is changed, it will automatically be redrawn.
  104. * @default
  105. * @type multiline_string
  106. *
  107. * @param FontSize
  108. * @text Font Size
  109. * @desc The default font size. Becomes the same size as other windows when 0 is specified.
  110. * @default 0
  111. * @type number
  112. *
  113. * @param WindowSkin
  114. * @text Window Skin
  115. * @desc The window skin. If not specified, the default will be used.
  116. * @default
  117. * @require 1
  118. * @dir img/system
  119. * @type file
  120. *
  121. * @param SwitchId
  122. * @text Display SwitchID
  123. * @desc Will be displayed on screen only when the specified switch is ON.
  124. * @default 0
  125. * @type switch
  126. *
  127. * @param ShowOpenAnimation
  128. * @text Open/Close Animation Display
  129. * @desc Displays a window open/close animation.
  130. * @default true
  131. * @type boolean
  132. */
  133. /*:ja
  134. * @target MZ
  135. * @plugindesc 各シーンに追加で任意のウィンドウを表示します。
  136. * @author トリアコンタン
  137. * @base PluginCommonBase
  138. * @orderAfter PluginCommonBase
  139. *
  140. * @param WindowList
  141. * @text ウィンドウリスト
  142. * @desc 各画面に追加するウィンドウのリストです。
  143. * @default []
  144. * @type struct<Window>[]
  145. *
  146. * @help ExtraWindow.js
  147. *
  148. * 任意のウィンドウを指定したシーンに追加表示できます。
  149. * 座標やフォントサイズ、開閉アニメの有無など基本的な情報を設定できます。
  150. * ウィンドウの表示テキストには制御文字が使用でき、変数値が変更されると
  151. * 自動的に再描画されます。
  152. *
  153. */

  154. /*~struct~Window:ja
  155. *
  156. * @param SceneName
  157. * @text 対象シーン
  158. * @desc 追加対象のシーンです。オリジナルのシーンを対象にする場合はシーンクラス名を直接記入します。
  159. * @type select
  160. * @default Scene_Title
  161. * @option タイトル
  162. * @value Scene_Title
  163. * @option マップ
  164. * @value Scene_Map
  165. * @option ゲームオーバー
  166. * @value Scene_Gameover
  167. * @option バトル
  168. * @value Scene_Battle
  169. * @option メインメニュー
  170. * @value Scene_Menu
  171. * @option アイテム
  172. * @value Scene_Item
  173. * @option スキル
  174. * @value Scene_Skill
  175. * @option 装備
  176. * @value Scene_Equip
  177. * @option ステータス
  178. * @value Scene_Status
  179. * @option オプション
  180. * @value Scene_Options
  181. * @option セーブ
  182. * @value Scene_Save
  183. * @option ロード
  184. * @value Scene_Load
  185. * @option ゲーム終了
  186. * @value Scene_End
  187. * @option ショップ
  188. * @value Scene_Shop
  189. * @option 名前入力
  190. * @value Scene_Name
  191. * @option デバッグ
  192. * @value Scene_Debug
  193. *
  194. * @param x
  195. * @text X座標
  196. * @desc X座標です。
  197. * @default 0
  198. * @type number
  199. * @min -9999
  200. *
  201. * @param y
  202. * @text Y座標
  203. * @desc Y座標です。
  204. * @default 0
  205. * @type number
  206. * @min -9999
  207. *
  208. * @param width
  209. * @text 横幅
  210. * @desc 横幅です。
  211. * @default 200
  212. * @type number
  213. *
  214. * @param height
  215. * @text 高さ
  216. * @desc 高さです。0を指定した場合、自動設定されます。
  217. * @default 0
  218. * @type number
  219. *
  220. * @param LineHeight
  221. * @text 行の高さ
  222. * @desc 1行あたりの高さです。
  223. * @default 36
  224. * @type number
  225. *
  226. * @param Text
  227. * @text 表示テキスト
  228. * @desc ウィンドウに表示される内容です。制御文字のもとになる変数が変更された場合、自動で再描画されます。
  229. * @default
  230. * @type multiline_string
  231. *
  232. * @param FontSize
  233. * @text フォントサイズ
  234. * @desc デフォルトのフォントサイズです。0を指定すると他のウィンドウと同じサイズになります。
  235. * @default 0
  236. * @type number
  237. *
  238. * @param WindowSkin
  239. * @text ウィンドウスキン
  240. * @desc ウィンドウスキンです。指定しなかった場合、デフォルトが使用されます。
  241. * @default
  242. * @require 1
  243. * @dir img/system
  244. * @type file
  245. *
  246. * @param SwitchId
  247. * @text 表示スイッチID
  248. * @desc 指定したスイッチがONの場合のみ画面に表示されます。
  249. * @default 0
  250. * @type switch
  251. *
  252. * @param ShowOpenAnimation
  253. * @text 開閉アニメ表示
  254. * @desc ウィンドウの開閉アニメーションを表示します。
  255. * @default true
  256. * @type boolean
  257. */

  258. (() => {
  259.     'use strict';
  260.     const script = document.currentScript;
  261.     const param  = PluginManagerEx.createParameter(script);

  262.     const _Scene_Base_create    = Scene_Base.prototype.create;
  263.     Scene_Base.prototype.create = function() {
  264.         _Scene_Base_create.apply(this, arguments);
  265.         this._extraWindows = this.findExtraWindowList().map(windowData => {
  266.             if (!windowData.height) {
  267.                 const lineCount = windowData.Text.split('\n').length;
  268.                 windowData.height = lineCount * (windowData.LineHeight || 36) + $gameSystem.windowPadding() * 2;
  269.             }
  270.             return new Window_SceneExtra(windowData);
  271.         });
  272.     };

  273.     const _Scene_Base_start    = Scene_Base.prototype.start;
  274.     Scene_Base.prototype.start = function() {
  275.         _Scene_Base_start.apply(this, arguments);
  276.         this._extraWindows.forEach(extraWindow => {
  277.             if (this._windowLayer) {
  278.                 this.addWindow(extraWindow);
  279.             } else {
  280.                 this.addChild(extraWindow);
  281.             }
  282.         });
  283.     };

  284.     Scene_Base.prototype.findExtraWindowList = function() {
  285.         const currentSceneName = PluginManagerEx.findClassName(this);
  286.         return (param.WindowList || []).filter(function(data) {
  287.             return data.SceneName === currentSceneName;
  288.         }, this);
  289.     };

  290.     class Window_SceneExtra extends Window_Base {

  291.         constructor(contentsData) {
  292.             super(contentsData);
  293.             if (this.isShowOpen() || !this.isValid()) {
  294.                 this.openness = 0;
  295.             }
  296.             this.refresh();
  297.         }

  298.         isShowOpen() {
  299.             return this._data.ShowOpenAnimation;
  300.         }

  301.         refresh() {
  302.             this.drawAllText();
  303.             if (this._data.WindowSkin) {
  304.                 this.windowskin = ImageManager.loadSystem(this._data.WindowSkin);
  305.             }
  306.         }

  307.         lineHeight() {
  308.             return this._data.LineHeight || super.lineHeight();
  309.         }

  310.         resetFontSettings() {
  311.             super.resetFontSettings();
  312.             if (this._data.FontSize) {
  313.                 this.contents.fontSize = this._data.FontSize;
  314.             }
  315.         };

  316.         drawAllText() {
  317.             const newText = PluginManagerEx.convertEscapeCharacters(this._data.Text);
  318.             if (this._text !== newText) {
  319.                 this._text = newText;
  320.                 this.contents.clear();
  321.                 this.drawTextEx(newText, 0, 0, this._data.width);
  322.             }
  323.         }

  324.         update() {
  325.             if (this.isValid()) {
  326.                 if (this.isShowOpen()) {
  327.                     this.open();
  328.                 } else {
  329.                     this.openness = 255;
  330.                 }
  331.             } else {
  332.                 if (this.isShowOpen()) {
  333.                     this.close();
  334.                 } else {
  335.                     this.openness = 0;
  336.                 }
  337.             }
  338.             super.update();
  339.             this.drawAllText();
  340.         }

  341.         isValid() {
  342.             return !this._data.SwitchId || $gameSwitches.value(this._data.SwitchId);
  343.         }

  344.         checkRectObject(contentsData) {
  345.             this._data = contentsData;
  346.             super.checkRectObject(contentsData);
  347.         }
  348.     }
  349.     window.Window_SceneExtra = Window_SceneExtra;
  350. })();
复制代码
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
6
在线时间
4 小时
注册时间
2023-10-6
帖子
8
6
发表于 2023-10-7 16:47:46 | 只看该作者
小秋橙 发表于 2023-5-6 16:50
MZ倒是有个很强的官方插件ExtraWindows.js,或许你应该找个大佬把它稍作修改改成MV能用的样子?
...

看完代码的我准备还是去找个成品
回复

使用道具 举报

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

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-4-27 14:22

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表