查看: 16616|回复: 20

[有事请教] 虚拟按键插件

[复制链接]
梦石
0
星屑
626
在线时间
300 小时
注册时间
2018-7-28
回帖
160
发表于 2019-5-1 22:45:37 | 显示全部楼层 |阅读模式
悬赏70星屑已解决
求大佬推荐好用的虚拟按键插件。

图片上是玩的一款别人做的游戏。他的按键可以随时切换按键和触屏模式。

并且可以在菜单和战斗界面使用。and 在是用按键是触屏就不会生效。

我自己找了好几个。但是都是效果都不太好。(可能这些要自己改代码)

我想的要求就是,能和上面我说的一样当然最好,不能我就想弄个

全程按键操作,并且触屏无效那种。

求大佬帮忙

Screenshot_2019-05-01-22-32-12_WPS图片_WPS图片_WPS图片.jpg
Screenshot_2019-05-01-22-32-27_WPS图片.png

最佳答案

查看完整内容

建立: 該設置需要在項目的img文件夾中創建一個新文件夾。 此文件夾必須命名為“mobileUI”。 下面是一個示例屏幕截圖。 將所有移動UI按鈕圖像放在此文件夾中,然後可以在插件參數中訪問它們。 在這帖40楼有個範例及按鍵圖象(未啓用) https://rpg.blue/thread-476413-4-1.html 啓用 点進去設定 D-pad設定 畫象 出現場景 X偏移(0最左) Y偏移〈0最上) 按鍵設定 on/off設定 ...
菜鸟一只
梦石
0
星屑
22879
在线时间
8598 小时
注册时间
2011-12-31
回帖
3270
发表于 2019-5-1 22:45:38 | 显示全部楼层
本帖最后由 tseyik 于 2019-5-3 20:45 编辑
清明上河図 发表于 2019-5-2 14:00
大佬。这样是什么问题。。。。


建立:
該設置需要在項目的img文件夾中創建一個新文件夾。 此文件夾必須命名為“mobileUI”。 下面是一個示例屏幕截圖。
0001.PNG
將所有移動UI按鈕圖像放在此文件夾中,然後可以在插件參數中訪問它們。


在這帖40楼有個範例及按鍵圖象(未啓用)
https://rpg.blue/thread-476413-4-1.html

啓用
0001.PNG
点進去設定
001.PNG
D-pad設定
畫象
出現場景
X偏移(0最左)
Y偏移〈0最上)
002.PNG
按鍵設定
0003.PNG
on/off設定
003.PNG

004.PNG

Capture.PNG
0002.PNG
回复

使用道具 举报

梦石
0
星屑
469
在线时间
447 小时
注册时间
2005-11-22
回帖
287
发表于 2019-5-2 00:43:29 | 显示全部楼层
回复

使用道具 举报

梦石
0
星屑
22799
在线时间
2623 小时
注册时间
2015-7-4
回帖
918
发表于 2019-5-2 09:54:43 | 显示全部楼层
这个可以在菜单、地图、战斗场景使用:
https://rpg.blue/thread-410350-1-7.html
回复

使用道具 举报

梦石
0
星屑
22879
在线时间
8598 小时
注册时间
2011-12-31
回帖
3270
发表于 2019-5-2 10:36:58 | 显示全部楼层
本帖最后由 tseyik 于 2019-5-2 13:15 编辑

https://forums.rpgmakerweb.com/i ... ons-and-dpad.94196/
Virtual Buttons and DPad
  1. "use strict";

  2. /*:
  3. * @plugindesc v1.4.0 Creates buttons on the screen for touch input
  4. * @author Aloe Guvner
  5. *
  6. *
  7. * @param dPadSettings
  8. * @text D-Pad Settings
  9. * @type struct<dpad>
  10. * @desc Settings for the D-Pad.
  11. *
  12. * @param keyButtonSettings
  13. * @text Key Button Settings
  14. * @type struct<keyButton>[]
  15. * @desc Settings for on-screen buttons that simulate key presses.
  16. *
  17. * @param controlButtonSettings
  18. * @text Control Button Settings
  19. * @type struct<controlButton>
  20. * @desc A "toggle" button that allows players to turn the UI
  21. * on and off.
  22. *
  23. * @param fadeDuration
  24. * @text Fade Duration
  25. * @desc Duration of hiding the buttons (number of frames)
  26. * for the buttons to fade and un-fade.
  27. * @default 20
  28. *
  29. * @param disableTouchWindows
  30. * @text Disable Touch Selectable Windows
  31. * @type text[]
  32. * @desc Disable the touch input for selectable windows
  33. * in these scenes.
  34. * @default ["Scene_Menu"]
  35. *
  36. * @param disableTouchMovement
  37. * @text Disable Touch Movement
  38. * @type boolean
  39. * @desc Disable touch movement on the map when a DPad is active.
  40. * @default false
  41. *
  42. * @param enableDiagonalInput
  43. * @text Enable Diagonal Input
  44. * @type boolean
  45. * @desc If the player touches in the corners of the D-Pad, both
  46. * direction inputs are recorded. See info in help file.
  47. * @default false
  48. *
  49. * @help
  50. *
  51. * //=============================================================================
  52. * // Background:
  53. * //=============================================================================
  54. * This plugin focuses on improving the user interface for mobile games created
  55. * in RPG Maker MV. This plugin allows the developer  to have virtual buttons
  56. * on the screen that interact with touch input.
  57. *
  58. * This plugin allows maximum flexibility for the developer, you can add
  59. * as many or as few buttons as you want to the screen, and you can add these buttons
  60. * on whichever screens you would like (i.e. map, menu, credits, title, etc.).
  61. *
  62. * //=============================================================================
  63. * // Functionality:
  64. * //=============================================================================
  65. *
  66. * This plugin can create 3 different types of buttons:
  67. * -Directional Pad
  68. * --A single picture which is used for up, left, right, and down movement.
  69. * --The picture is divided into 9 sections. The top 3 sections trigger the "up"
  70. * input, the left 3 sections trigger the "left" input, the right 3 sections
  71. * trigger the "right" input, and the bottom 3 section triggers the "down" input.
  72. * --The middle section does not trigger any input.
  73. * --The scenes that this button appears in can be defined.
  74. * --This button is not mandatory.
  75. *
  76. * -Key buttons
  77. * --These buttons can be used to represent any key. Common keys to use would be
  78. * "ok" , "escape", "pagedown", "pageup".
  79. * --However, these can be any key, and there can be as many or as few as the developer
  80. * would like.
  81. * --Additionally, the scenes that these buttons appear in can be controlled individually.
  82. *
  83. *
  84. * -Control button
  85. * --The control button, if pressed, will collapse and hide other buttons on the screen.
  86. * --If pressed again, it will expand and show other buttons on the screen.
  87. * --You can configure which other buttons are affected. This can allow you to create
  88. *   a dynamic menu where pressing this button opens other buttons for "Items", "Save",
  89. *   etc., while leaving the DPad or any other button active all of the time.
  90. * --The scenes that this button appears in can be defined.
  91. * --This button is not mandatory.
  92. *
  93. * //=============================================================================
  94. * // Touch Input Methods:
  95. * //=============================================================================
  96. *
  97. * The following methods can be chosen for any of the key buttons. The default
  98. * method is "triggered".
  99. *
  100. * Triggered:
  101. *   This input method occurs when the button is just pressed down. It occurs only
  102. * once, in the same frame that the button was pressed.
  103. *
  104. * Pressed:
  105. *   This input method occurs every frame while the button is pressed down. Any action
  106. * that this button is doing will execute every frame (60 frames per second)
  107. *
  108. * Repeated:
  109. *   This input method occurs after 24 frames from when the button is pressed, and
  110. * then occurs every 6 frames while the button is still pressed.
  111. *
  112. * Long Pressed:
  113. *   This input method occurs after 24 frames from when the button is pressed, and
  114. * then occurs every frame while the button is still pressed.
  115. *
  116. * Released:
  117. *   This input method occurs when the button is no longer being pressed.
  118. *
  119. * //=============================================================================
  120. * // Setup:
  121. * //=============================================================================
  122. * This plugin requires a new folder to be created within the project "img" folder.
  123. * The folder must be titled "mobileUI".
  124. * Place all UI button images into this folder, and they can be accessed from the
  125. * plugin parameters.
  126. *
  127. * //=============================================================================
  128. * // Vibrate Parameter
  129. * //=============================================================================
  130. * Buttons can trigger a vibrate on the mobile device when pressed, controlled by
  131. * a parameter.
  132. * This parameter follows a pattern of vibrate,pause,vibrate,pause, etc.
  133. * Separate each time interval by a comma.
  134. * Examples:
  135. * 200 --> vibrate for 200ms
  136. * 100,30,100,30,100,30  --> vibrate for 100ms, pause for 30ms; repeat 2 more times
  137. *
  138. * Note that most devices support the Vibration API, but not all.
  139. * Additionally, this may not work in all methods of deployment.
  140. *
  141. * //=============================================================================
  142. * // Plugin Commands:
  143. * //=============================================================================
  144. * All plugin commands begin with MobileUI.
  145. * All plugin commands are not case sensitive (i.e. DPad is the same as dpad)
  146. *
  147. * //=============================================================================
  148. * hide: hides the specified button
  149. * //=============================================================================
  150. * Allowed first arguments:
  151. * -DPad
  152. * -Control
  153. * -Any key button defined in the parameters
  154. *
  155. * Allowed second arguments:
  156. * -instant (optional, this will hide the button instantly)
  157. *
  158. * Examples:
  159. * MobileUI hide DPad
  160. * mobileui hide Ok instant
  161. * MobileUI hide PageDown
  162. *
  163. * //=============================================================================
  164. * show: shows the specified button
  165. * //=============================================================================
  166. * Allowed first arguments:
  167. * -DPad
  168. * -Control
  169. * -Any key button defined in the parameters
  170. *
  171. * Allowed second arguments:
  172. * -instant (optional, this will show the button instantly)
  173. *
  174. * Examples:
  175. * MobileUI show dpad
  176. * mobileui show ok
  177. * MobileUI show PageUp instant
  178. *
  179. * //=============================================================================
  180. * Diagonal Movement Parameter
  181. * //=============================================================================
  182. *
  183. * There is a parameter that controls whether diagonal input is recorded from the
  184. * D-Pad. This is not a diagonal movement plugin! This parameter merely controls
  185. * whether touching on the top left will add the input values of both "top" and
  186. * "left" to the input state. Other diagonal movement plugins would consume these
  187. * input values to move the character diagonally.
  188. *
  189. * If your game uses diagonal movement, this parameter must be on. If your game
  190. * does not use diagonal movement, it is recommended to turn this parameter off.
  191. *
  192. * //=============================================================================
  193. * Terms of Use:
  194. * //=============================================================================
  195. * Free for use in commercial or non-commercial projects.
  196. * Credits required to: Aloe Guvner
  197. *
  198. * //=============================================================================
  199. * Version History:
  200. * //=============================================================================
  201. * v1.4.0 (December 13 2018)
  202. * --Added ability to configure which buttons are affected by the "control" button
  203. *   Can be used to create dynamic menus.
  204. * v1.3.1 (October 30 2018)
  205. * --Added a parameter to control whether diagonal movement is detected as a
  206. *   possible fix for a hard to reproduce movement bug.
  207. * v1.3.0 (September 27 2018)
  208. * --Added a parameter to choose to disable the normal touch input on any chosen
  209. *   scene. The only touch input enabled on these scenes is the mobile UI.
  210. * v1.2.3 (September 27 2018)
  211. * --Fixed a bug where buttons that the player had chosen to hide would reappear
  212. *   after a game message.
  213. * v1.2.2 (September 27 2018)
  214. * --Fixed a bug where buttons could be pressed before they were fully visible
  215. * v1.2.1 (September 27 2018)
  216. * --Added an "instant" feature to hide/show for smoother cutscene transitions
  217. * v1.2.0 (August 26 2018)
  218. * --Added ability to vibrate when button is pressed
  219. * v1.1.0 (June 27 2018)
  220. * --Fixed bug with awkward player movement on the DPad
  221. * --Added ability to specify the type of touch input on key buttons
  222. * v1.0.3 (May 14 2018)
  223. * --Added ability to run custom code when a key button is pressed
  224. * v1.0.2 (May 9 2018)
  225. * --Added ability to play a sound effect when a button is pressed
  226. * --Fixed a bug where the parameters weren't read correctly due to plugin name change
  227. * --Fixed a bug where the control button didn't hide the dpad properly
  228. * v1.0.1 (May 8 2018)
  229. * --Added a version compatible with MV earlier than 1.6.0 using Babel.js
  230. * v1.0.0 (April 17 2018)
  231. * --Initial release
  232. *
  233. * //=============================================================================
  234. * End of Help File
  235. * //=============================================================================
  236. */

  237. /*~struct~dpad:
  238. * @param image
  239. * @text Image
  240. * @type file
  241. * @dir img/mobileUI
  242. * @desc File path for the D-Pad image
  243. * @require 1
  244. *
  245. * @param activeScenes
  246. * @text Scenes to show the D-Pad
  247. * @type text[]
  248. * @desc A list of scenes where the D-Pad will be active.
  249. * Ex. Scene_Map, Scene_Title, etc.
  250. * @default ["Scene_Title","Scene_Map"]
  251. *
  252. * @param x
  253. * @text X
  254. * @desc X position of the D-Pad. Formulas are allowed.
  255. * (ex. Graphics.width - 96)
  256. * @type text
  257. * @default 0
  258. *
  259. * @param y
  260. * @text Y
  261. * @desc Y position of the D-Pad. Formulas are allowed.
  262. * (ex. Graphics.height - 96)
  263. * @type text
  264. * @default 0
  265. *
  266. * @param soundEffect
  267. * @text Sound Effect
  268. * @type struct<soundEffect>
  269. * @desc Sound Effect to play when button is pressed.
  270. * Depending on scenario, SE might already play. Test first.
  271. *
  272. */

  273. /*~struct~keyButton:
  274. * @param name
  275. * @text Name
  276. * @type text
  277. * @desc The name of the button
  278. *
  279. * @param inputMethod
  280. * @text Input Method
  281. * @type select
  282. * @option Triggered
  283. * @value 0
  284. * @option Pressed
  285. * @value 1
  286. * @option Repeated
  287. * @value 2
  288. * @option Long Pressed
  289. * @value 3
  290. * @option Released
  291. * @value 4
  292. * @desc The type of touch input that will trigger the button.
  293. * See the help file for full descriptions of the options.
  294. * @default 0
  295. *
  296. * @param inputTrigger
  297. * @text Input Code
  298. * @type text
  299. * @desc The input code triggered when the button is pressed.
  300. * ex. ok / escape / pagedown / pageup
  301. *
  302. * @param image
  303. * @text Image
  304. * @type file
  305. * @dir img/mobileUI
  306. * @desc File path for the button image
  307. * @require 1
  308. *
  309. * @param activeScenes
  310. * @text Scenes to show the button
  311. * @type text[]
  312. * @desc A list of scenes where the button will be active.
  313. * Ex. Scene_Map, Scene_Title, etc.
  314. * @default ["Scene_Title","Scene_Map"]
  315. *
  316. * @param x
  317. * @text X
  318. * @type text
  319. * @desc X position of the button. Formulas are allowed.
  320. * (ex. Graphics.width - 96)
  321. * @default 0
  322. *
  323. * @param y
  324. * @text Y
  325. * @type text
  326. * @desc Y position of the button. Formulas are allowed.
  327. * (ex. Graphics.height - 96)
  328. * @default 0
  329. *
  330. * @param soundEffect
  331. * @text Sound Effect
  332. * @type struct<soundEffect>
  333. * @desc Sound Effect to play when button is pressed.
  334. * Depending on scenario, SE might already play. Test first.
  335. *
  336. * @param customCode
  337. * @text Custom Code
  338. * @type note
  339. * @desc Custom Javascript code to run on button press.
  340. * Use the 'this' keyword to refer to the current scene.
  341. *
  342. * @param vibratePattern
  343. * @text Vibrate Pattern
  344. * @type text
  345. * @default 0
  346. * @desc Pattern of miliseconds to vibrate on press.
  347. * Use 0 for no vibration. See help for more info.
  348. */

  349. /*~struct~controlButton:
  350. * @param image
  351. * @text Image
  352. * @type file
  353. * @dir img/mobileUI
  354. * @desc File path for the button image
  355. * @require 1
  356. *
  357. * @param activeScenes
  358. * @text Scenes to show the control button
  359. * @type text[]
  360. * @desc A list of scenes where the button will be active.
  361. * Ex. Scene_Map, Scene_Title, etc.
  362. * @default ["Scene_Title","Scene_Map"]
  363. *
  364. * @param x
  365. * @text X
  366. * @type text
  367. * @desc X position of the button. Formulas are allowed.
  368. * (ex. Graphics.width - 96)
  369. * @default 0
  370. *
  371. * @param y
  372. * @text Y
  373. * @type text
  374. * @desc Y position of the button. Formulas are allowed.
  375. * (ex. Graphics.height - 96)
  376. * @default 0
  377. *
  378. * @param soundEffect
  379. * @text Sound Effect
  380. * @type struct<soundEffect>
  381. * @desc Sound Effect to play when button is pressed.
  382. * Depending on scenario, SE might already play. Test first.
  383. *
  384. * @param buttonsToHide
  385. * @text Buttons To Show / Hide
  386. * @type text[]
  387. * @desc A list of the Key Buttons to show and hide when
  388. * this button is pressed. Leave empty to hide all.
  389. * @default []
  390. *
  391. * @param hideDPad
  392. * @text Show / Hide DPad?
  393. * @type boolean
  394. * @desc Controls whether the DPad is affected when
  395. * this button is pressed.
  396. * @default true
  397. *
  398. */

  399. /*~struct~soundEffect:
  400. * @param name
  401. * @text Sound Effect Name
  402. * @type file
  403. * @dir audio/se
  404. * @desc Sound effect to play when the button is pressed.
  405. * @default
  406. * @require 1
  407. *
  408. * @param volume
  409. * @text Volume
  410. * @type number
  411. * @min 0
  412. * @max 100
  413. * @desc Volume of the sound effect, in %
  414. * Allowed values: 0% - 100%
  415. * @default 90
  416. *
  417. * @param pitch
  418. * @text Pitch
  419. * @type number
  420. * @min 50
  421. * @max 150
  422. * @desc Pitch of the sound effect, in %
  423. * Allowed values: 50% - 150%
  424. * @default 100
  425. *
  426. * @param pan
  427. * @text Pan
  428. * @type number
  429. * @min -100
  430. * @max 100
  431. * @desc Pan of the sound effect
  432. * Allowed values: -100 - 100
  433. * @default 0
  434. *
  435. */

  436. (function () {
  437.         "use strict";

  438.         var Alias = {};
  439.         var Parameters = {};
  440.         //=============================================================================
  441.         // Utils
  442.         //=============================================================================
  443.         // Create a utility function to parse complex parameters.
  444.         //=============================================================================

  445.         Utils.recursiveParse = function (param) {
  446.                 try {
  447.                         return JSON.parse(param, function (key, value) {
  448.                                 try {
  449.                                         return this.recursiveParse(value);
  450.                                 } catch (e) {
  451.                                         return value;
  452.                                 }
  453.                         }.bind(this));
  454.                 } catch (e) {
  455.                         return param;
  456.                 }
  457.         };

  458.         //=============================================================================
  459.         // Parameters
  460.         //=============================================================================
  461.         // Read and parse parameters into a locally scoped Parameters object.
  462.         //=============================================================================

  463.         Object.keys(PluginManager.parameters("ALOE_MobileUI")).forEach(function (a) {
  464.                 return Parameters[a] = Utils.recursiveParse(PluginManager.parameters("ALOE_MobileUI")[a]);
  465.         });

  466.         //=============================================================================
  467.         // ImageManager
  468.         //=============================================================================
  469.         // Load and reserve mobile UI images.
  470.         //=============================================================================

  471.         ImageManager.loadMobileUI = function (filename, hue) {
  472.                 return this.loadBitmap('img/mobileUI/', filename, hue, true);
  473.         };

  474.         ImageManager.reserveMobileUI = function (filename, hue, reservationId) {
  475.                 return this.reserveBitmap('img/mobileUI/', filename, hue, true, reservationId);
  476.         };

  477.         //=============================================================================
  478.         // Sprite_Button
  479.         //=============================================================================
  480.         // Sprite for the UI button(s)
  481.         // Parent class for Sprite_DirectionalPad, Sprite_KeyButton, Sprite_ControlButton
  482.         //=============================================================================

  483.         function Sprite_Button() {
  484.                 this.initialize.apply(this, arguments);
  485.         }

  486.         Sprite_Button.prototype = Object.create(Sprite_Base.prototype);
  487.         Sprite_Button.prototype.constructor = Sprite_Button;

  488.         Sprite_Button.prototype.initialize = function (x, y, normalImage, soundEffect, vibratePattern) {
  489.                 Sprite_Base.prototype.initialize.call(this);
  490.                 if (normalImage) {
  491.                         this.bitmap = ImageManager.loadMobileUI(normalImage);
  492.                 }
  493.                 if (soundEffect) {
  494.                         this._soundEffect = soundEffect;
  495.                 }
  496.                 if (vibratePattern) {
  497.                         if (!window.navigator.vibrate) {
  498.                                 this._vibratePattern = 0;
  499.                         } else if (typeof vibratePattern === 'number') {
  500.                                 this._vibratePattern = vibratePattern;
  501.                         } else {
  502.                                 this._vibratePattern = vibratePattern.split(',').map(function (num) {
  503.                                         return parseInt(num);
  504.                                 });
  505.                         }
  506.                 }
  507.                 if (isNaN(x)) {
  508.                         x = eval(x);
  509.                 }
  510.                 if (isNaN(y)) {
  511.                         y = eval(y);
  512.                 }
  513.                 this.move(x, y);
  514.                 this._start = new Point(null, null);
  515.                 this._distance = new Point(null, null);
  516.                 this._destination = new Point(null, null);
  517.                 this._velocity = new Point(null, null);
  518.                 this._origin = new Point(x, y);
  519.                 this._hiding = false;
  520.                 this._duration = Parameters["fadeDuration"];
  521.                 this.active = true;
  522.                 this.z = 5;
  523.         };

  524.         Sprite_Button.prototype.update = function () {
  525.                 Sprite_Base.prototype.update.call(this);
  526.                 if (this.active) {
  527.                         this.updateTouchInput();
  528.                 }
  529.                 if (this.moving) {
  530.                         this.updatePosition();
  531.                 }
  532.                 if (!this.active) {
  533.                         this.updateActive();
  534.                 }
  535.         };

  536.         Sprite_Button.prototype.updateTouchInput = function () {};

  537.         Sprite_Button.prototype.updateVisibility = function () {
  538.                 if (this._hiding && this.opacity > 0) {
  539.                         this.opacity -= 255 / this._duration;
  540.                 } else if (!this._hiding && this.opacity < 255) {
  541.                         this.opacity += 255 / this._duration;
  542.                 }
  543.         };

  544.         Sprite_Button.prototype.updateActive = function () {
  545.                 if (this.opacity === 255) {
  546.                         this.active = true;
  547.                 }
  548.         };

  549.         Sprite_Button.prototype.updatePosition = function () {
  550.                 this.x += this._velocity.x;
  551.                 this.y += this._velocity.y;

  552.                 var currentPos = new Point(this.x, this.y);
  553.                 var currentDistance = this.absDistance(this._start, currentPos);
  554.                 if (currentDistance >= this._distance.abs) {
  555.                         this.x = this._destination.x;
  556.                         this.y = this._destination.y;
  557.                         this._velocity.x = 0;
  558.                         this._velocity.y = 0;
  559.                         this.moving = false;
  560.                 }
  561.         };

  562.         Sprite_Button.prototype.hide = function () {
  563.                 this._hiding = true;
  564.                 this.active = false;
  565.         };

  566.         Sprite_Button.prototype.show = function () {
  567.                 this._hiding = false;
  568.         };

  569.         Sprite_Button.prototype.hideInstant = function () {
  570.                 this._hiding = true;
  571.                 this.opacity = 0;
  572.                 this.active = false;
  573.         };

  574.         Sprite_Button.prototype.showInstant = function () {
  575.                 this._hiding = false;
  576.                 this.opacity = 255;
  577.                 this.active = true;
  578.         };

  579.         Sprite_Button.prototype.collapse = function (x, y) {
  580.                 this._destination.x = x;
  581.                 this._destination.y = y;
  582.                 this._start.x = this.x;
  583.                 this._start.y = this.y;

  584.                 this._distance.x = this._destination.x - this._start.x;
  585.                 this._distance.y = this._destination.y - this._start.y;
  586.                 this._distance.abs = this.absDistance(this._destination, this._start);

  587.                 this._velocity.x = this._distance.x / this._duration;
  588.                 this._velocity.y = this._distance.y / this._duration;

  589.                 this.moving = true;
  590.         };

  591.         Sprite_Button.prototype.expand = function () {
  592.                 this._destination.x = this._origin.x;
  593.                 this._destination.y = this._origin.y;
  594.                 this._start.x = this.x;
  595.                 this._start.y = this.y;

  596.                 this._distance.x = this._destination.x - this._start.x;
  597.                 this._distance.y = this._destination.y - this._start.y;
  598.                 this._distance.abs = this.absDistance(this._destination, this._start);

  599.                 this._velocity.x = this._distance.x / this._duration;
  600.                 this._velocity.y = this._distance.y / this._duration;

  601.                 this.moving = true;
  602.         };

  603.         Sprite_Button.prototype.absDistance = function (pos1, pos2) {
  604.                 return Math.sqrt(Math.pow(pos1.x - pos2.x, 2) + Math.pow(pos1.y - pos2.y, 2));
  605.         };

  606.         //=============================================================================
  607.         // Sprite_DirectionalPad
  608.         //=============================================================================
  609.         // Sprite for the Directional Pad
  610.         //=============================================================================

  611.         function Sprite_DirectionalPad() {
  612.                 this.initialize.apply(this, arguments);
  613.         }

  614.         Sprite_DirectionalPad.prototype = Object.create(Sprite_Button.prototype);
  615.         Sprite_DirectionalPad.prototype.constructor = Sprite_DirectionalPad;

  616.         Sprite_DirectionalPad.prototype.initialize = function (x, y, image, soundEffect) {
  617.                 Sprite_Button.prototype.initialize.call(this, x, y, image, soundEffect);
  618.                 this._lastInput = '';
  619.                 this._hiding = false;
  620.         };

  621.         Sprite_DirectionalPad.prototype.updateTouchInput = function () {
  622.                 this.clearLastDirection();
  623.                 if (TouchInput.isPressed()) {
  624.                         var point = new Point(TouchInput.x, TouchInput.y);
  625.                         if (this.containsPoint(point)) {
  626.                                 if (this._soundEffect) {
  627.                                         AudioManager.playSe(this._soundEffect);
  628.                                 }
  629.                                 var index = this.whichIndex(point);
  630.                                 switch (index) {
  631.                                         case 0:
  632.                                                 if (Parameters.enableDiagonalInput) {
  633.                                                         Input._currentState["up"] = true;
  634.                                                         Input._currentState["left"] = true;
  635.                                                         this._lastInput = "up-left";
  636.                                                 }
  637.                                                 break;
  638.                                         case 1:
  639.                                                 Input._currentState["up"] = true;
  640.                                                 this._lastInput = "up";
  641.                                                 break;
  642.                                         case 2:
  643.                                                 if (Parameters.enableDiagonalInput) {
  644.                                                         Input._currentState["right"] = true;
  645.                                                         Input._currentState["up"] = true;
  646.                                                         this._lastInput = "up-right";
  647.                                                 }
  648.                                                 break;
  649.                                         case 3:
  650.                                                 Input._currentState["left"] = true;
  651.                                                 this._lastInput = "left";
  652.                                                 break;
  653.                                         case 4:
  654.                                                 break;
  655.                                         case 5:
  656.                                                 Input._currentState["right"] = true;
  657.                                                 this._lastInput = "right";
  658.                                                 break;
  659.                                         case 6:
  660.                                                 if (Parameters.enableDiagonalInput) {
  661.                                                         Input._currentState["left"] = true;
  662.                                                         Input._currentState["down"] = true;
  663.                                                         this._lastInput = "down-left";
  664.                                                 }
  665.                                                 break;
  666.                                         case 7:
  667.                                                 Input._currentState["down"] = true;
  668.                                                 this._lastInput = "down";
  669.                                                 break;
  670.                                         case 8:
  671.                                                 if (Parameters.enableDiagonalInput) {
  672.                                                         Input._currentState["down"] = true;
  673.                                                         Input._currentState["right"] = true;
  674.                                                         this._lastInput = "down-right";
  675.                                                 }
  676.                                                 break;
  677.                                         default:
  678.                                                 break;
  679.                                 }
  680.                         }
  681.                 }
  682.         };

  683.         Sprite_DirectionalPad.prototype.whichIndex = function (point) {
  684.                 var index = 0;
  685.                 index += point.x - this.x > this.width / 3 ? point.x - this.x > this.width * 2 / 3 ? 2 : 1 : 0;
  686.                 index += point.y - this.y > this.height / 3 ? point.y - this.y > this.height * 2 / 3 ? 6 : 3 : 0;
  687.                 return index;
  688.         };

  689.         Sprite_DirectionalPad.prototype.clearLastDirection = function () {
  690.                 if (this._lastInput) {
  691.                         this._lastInput.split("-").forEach(function (a) {
  692.                                 return Input._currentState[a] = false;
  693.                         });
  694.                         this._lastInput = '';
  695.                 }
  696.         };

  697.         //=============================================================================
  698.         // Sprite_KeyButton
  699.         //=============================================================================
  700.         // Sprite for the buttons that simulate a key input (besides arrow keys).
  701.         // Ex. "ok", "cancel", "pageup", "pagedown"
  702.         //=============================================================================

  703.         function Sprite_KeyButton() {
  704.                 this.initialize.apply(this, arguments);
  705.         }

  706.         Sprite_KeyButton.prototype = Object.create(Sprite_Button.prototype);
  707.         Sprite_KeyButton.prototype.constructor = Sprite_KeyButton;

  708.         Sprite_KeyButton.prototype.initialize = function (x, y, image, soundEffect, inputTrigger, customCode, vibratePattern) {
  709.                 var inputMethod = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 0;

  710.                 Sprite_Button.prototype.initialize.call(this, x, y, image, soundEffect, vibratePattern);
  711.                 if (inputTrigger) {
  712.                         this._inputTrigger = inputTrigger;
  713.                 }
  714.                 if (customCode) {
  715.                         this._customCode = customCode;
  716.                         this._customFunction = new Function(customCode).bind(SceneManager._scene);
  717.                 }
  718.                 this._inputMethod = inputMethod;
  719.         };

  720.         Sprite_KeyButton.prototype.isTouchTriggered = function () {
  721.                 switch (this._inputMethod) {
  722.                         case 0:
  723.                                 // Was just pressed
  724.                                 return TouchInput.isTriggered();
  725.                         case 1:
  726.                                 //Currently pressed down
  727.                                 return TouchInput.isPressed();
  728.                         case 2:
  729.                                 //Is repeated
  730.                                 return TouchInput.isRepeated();
  731.                         case 3:
  732.                                 //Is kept pressed
  733.                                 return TouchInput.isLongPressed();
  734.                         case 4:
  735.                                 //Was just released
  736.                                 return TouchInput.isReleased();
  737.                         default:
  738.                                 return TouchInput.isTriggered();
  739.                 }
  740.         };

  741.         Sprite_KeyButton.prototype.updateTouchInput = function () {
  742.                 if (this.isTouchTriggered()) {
  743.                         var point = new Point(TouchInput.x, TouchInput.y);
  744.                         if (this.containsPoint(point)) {
  745.                                 if (this._soundEffect) {
  746.                                         AudioManager.playSe(this._soundEffect);
  747.                                 }
  748.                                 if (this._vibratePattern) {
  749.                                         window.navigator.vibrate(this._vibratePattern);
  750.                                 }
  751.                                 if (this._customFunction) {
  752.                                         this._customFunction();
  753.                                 }
  754.                                 if (this._inputTrigger) {
  755.                                         Input._currentState[this._inputTrigger] = true;
  756.                                 }
  757.                         } else {
  758.                                 Input._currentState[this._inputTrigger] = false;
  759.                         }
  760.                 } else {
  761.                         Input._currentState[this._inputTrigger] = false;
  762.                 }
  763.         };

  764.         //=============================================================================
  765.         // Sprite_ControlButton
  766.         //=============================================================================
  767.         // Sprite for the button that activates / deactivates all other buttons.
  768.         //=============================================================================

  769.         function Sprite_ControlButton() {
  770.                 this.initialize.apply(this, arguments);
  771.         }

  772.         Sprite_ControlButton.prototype = Object.create(Sprite_Button.prototype);
  773.         Sprite_ControlButton.prototype.constructor = Sprite_ControlButton;

  774.         Sprite_ControlButton.prototype.initialize = function (x, y, image, soundEffect) {
  775.                 Sprite_Button.prototype.initialize.call(this, x, y, image, soundEffect);
  776.                 this._inputTrigger = "control";
  777.                 this._buttonsHidden = false;
  778.         };

  779.         Sprite_ControlButton.prototype.updateTouchInput = function () {
  780.                 if (TouchInput.isTriggered()) {
  781.                         var point = new Point(TouchInput.x, TouchInput.y);
  782.                         if (this.containsPoint(point)) {
  783.                                 if (this._soundEffect) {
  784.                                         AudioManager.playSe(this._soundEffect);
  785.                                 }
  786.                                 if (this._buttonsHidden) {
  787.                                         this.showAllButtons();
  788.                                 } else {
  789.                                         this.hideAllButtons();
  790.                                 }
  791.                         }
  792.                 }
  793.         };

  794.         Sprite_ControlButton.prototype.showAllButtons = function () {
  795.                 var _this = this;

  796.                 var params = Parameters["controlButtonSettings"];
  797.                 if (params.buttonsToHide.length > 0) {
  798.                         params.buttonsToHide.forEach(function (buttonName) {
  799.                                 if (!_this._keyButtons[buttonName]) {
  800.                                         console.error(buttonName + " is not a key button, check your Mobile UI plugin configuration.");
  801.                                         return;
  802.                                 }
  803.                                 _this._keyButtons[buttonName].show();
  804.                                 _this._keyButtons[buttonName].expand();
  805.                         });
  806.                 } else {
  807.                         Object.values(this._keyButtons).forEach(function (button) {
  808.                                 button.show();
  809.                                 button.expand();
  810.                         });
  811.                 }
  812.                 if (params.hideDPad && this._directionalPad) {
  813.                         this._directionalPad.show();
  814.                         this._directionalPad.expand();
  815.                 }
  816.                 this._buttonsHidden = false;
  817.         };

  818.         Sprite_ControlButton.prototype.hideAllButtons = function () {
  819.                 var _this2 = this;

  820.                 var params = Parameters["controlButtonSettings"];
  821.                 if (params.buttonsToHide.length > 0) {
  822.                         params.buttonsToHide.forEach(function (buttonName) {
  823.                                 if (!_this2._keyButtons[buttonName]) {
  824.                                         console.error(buttonName + " is not a key button, check your Mobile UI plugin configuration.");
  825.                                         return;
  826.                                 }
  827.                                 _this2._keyButtons[buttonName].hide();
  828.                                 _this2._keyButtons[buttonName].collapse(_this2.x, _this2.y);
  829.                         });
  830.                 } else {
  831.                         Object.values(this._keyButtons).forEach(function (button) {
  832.                                 button.hide();
  833.                                 button.collapse(_this2.x, _this2.y);
  834.                         });
  835.                 }
  836.                 if (params.hideDPad && this._directionalPad) {
  837.                         this._directionalPad.hide();
  838.                         this._directionalPad.collapse(this.x, this.y);
  839.                 }
  840.                 this._buttonsHidden = true;
  841.         };

  842.         //=============================================================================
  843.         // Scene_Base
  844.         //=============================================================================
  845.         // Methods to create the buttons in any scene.
  846.         //=============================================================================

  847.         Alias.Scene_Boot_create = Scene_Boot.prototype.create;
  848.         Scene_Boot.prototype.create = function () {
  849.                 Alias.Scene_Boot_create.call(this);
  850.                 if (Parameters["dPadSettings"].activeScenes) {
  851.                         Parameters["dPadSettings"].activeScenes = Parameters["dPadSettings"].activeScenes.map(function (a) {
  852.                                 return eval(a);
  853.                         });
  854.                 }
  855.                 if (Parameters["keyButtonSettings"]) {
  856.                         Parameters["keyButtonSettings"].forEach(function (a) {
  857.                                 return a.activeScenes = a.activeScenes.map(function (b) {
  858.                                         return b = eval(b);
  859.                                 });
  860.                         });
  861.                 }
  862.                 if (Parameters["controlButtonSettings"].activeScenes) {
  863.                         Parameters["controlButtonSettings"].activeScenes = Parameters["controlButtonSettings"].activeScenes.map(function (a) {
  864.                                 return eval(a);
  865.                         });
  866.                 }
  867.         };

  868.         Alias.Scene_Base_start = Scene_Base.prototype.start;
  869.         Scene_Base.prototype.start = function () {
  870.                 Alias.Scene_Base_start.call(this);
  871.                 this.createDirPad();
  872.                 this.createKeyButtons();
  873.                 this.createControlButton();
  874.         };

  875.         Scene_Base.prototype.createDirPad = function () {
  876.                 var params = Parameters["dPadSettings"];
  877.                 if (params) {
  878.                         if (params.activeScenes.length > 0 && params.activeScenes.contains(this.constructor)) {
  879.                                 var x = params.x;
  880.                                 var y = params.y;
  881.                                 var image = params.image || "";
  882.                                 var soundEffect = params.soundEffect;
  883.                                 this._directionalPad = new Sprite_DirectionalPad(x, y, image, soundEffect);

  884.                                 this.addChild(this._directionalPad);
  885.                         }
  886.                 }
  887.         };

  888.         Scene_Base.prototype.createKeyButtons = function () {
  889.                 var params = Parameters["keyButtonSettings"];
  890.                 if (params) {
  891.                         if (params.length > 0) {
  892.                                 this._keyButtons = {};
  893.                                 for (var i = 0; i < params.length; i++) {
  894.                                         if (params[i].activeScenes.length > 0 && params[i].activeScenes.contains(this.constructor)) {
  895.                                                 var a = params[i];
  896.                                                 this._keyButtons[a.name.toLowerCase()] = new Sprite_KeyButton(a.x, a.y, a.image, a.soundEffect, a.inputTrigger.toLowerCase(), a.customCode, a.vibratePattern, a.inputMethod);
  897.                                                 this.addChild(this._keyButtons[a.name.toLowerCase()]);
  898.                                         }
  899.                                 }
  900.                         }
  901.                 }
  902.         };

  903.         Scene_Base.prototype.createControlButton = function () {
  904.                 var params = Parameters["controlButtonSettings"];
  905.                 if (params) {
  906.                         if (params.activeScenes.length > 0 && params.activeScenes.contains(this.constructor)) {
  907.                                 var x = params.x;
  908.                                 var y = params.y;
  909.                                 var image = params.image || "";
  910.                                 var soundEffect = params.soundEffect;
  911.                                 this._controlButton = new Sprite_ControlButton(x, y, image, soundEffect);
  912.                                 this.addChild(this._controlButton);
  913.                                 this._controlButton._keyButtons = this._keyButtons;
  914.                                 this._controlButton._directionalPad = this._directionalPad;
  915.                         }
  916.                 }
  917.         };

  918.         Scene_Base.prototype.hideMobileUI = function () {
  919.                 var _this3 = this;

  920.                 if (this._directionalPad) {
  921.                         this._directionalPad.hide();
  922.                 }
  923.                 if (this._keyButtons) {
  924.                         Object.keys(this._keyButtons).forEach(function (a) {
  925.                                 return _this3._keyButtons[a].hide();
  926.                         });
  927.                 }
  928.                 if (this._controlButton) {
  929.                         this._controlButton.hide();
  930.                 }
  931.         };

  932.         Scene_Base.prototype.showMobileUI = function () {
  933.                 var _this4 = this;

  934.                 if (this._directionalPad) {
  935.                         this._directionalPad.show();
  936.                 }
  937.                 if (this._keyButtons) {
  938.                         Object.keys(this._keyButtons).forEach(function (a) {
  939.                                 return _this4._keyButtons[a].show();
  940.                         });
  941.                 }
  942.                 if (this._controlButton) {
  943.                         this._controlButton.show();
  944.                 }
  945.         };

  946.         Alias.Scene_Base_terminate = Scene_Base.prototype.terminate;
  947.         Scene_Base.prototype.terminate = function () {
  948.                 var _this5 = this;

  949.                 Alias.Scene_Base_terminate.call(this);
  950.                 if (this._directionalPad) {
  951.                         this.removeChild(this._directionalPad);
  952.                 }
  953.                 if (this._keyButtons) {
  954.                         Object.keys(this._keyButtons).forEach(function (a) {
  955.                                 return _this5.removeChild(_this5._keyButtons[a]);
  956.                         });
  957.                 }
  958.                 if (this._controlButton) {
  959.                         this.removeChild(this._controlButton);
  960.                 }
  961.         };

  962.         //=============================================================================
  963.         // Scene_Map
  964.         //=============================================================================
  965.         // If map movement is disabled from the parameters, return.
  966.         // If an active button is pressed, don't do the usual map movement.
  967.         //=============================================================================

  968.         Alias.Scene_Map_processMapTouch = Scene_Map.prototype.processMapTouch;
  969.         Scene_Map.prototype.processMapTouch = function () {
  970.                 var _this6 = this;

  971.                 if (Parameters['disableTouchMovement'] && this._directionalPad && this._directionalPad.active) {
  972.                         return;
  973.                 }
  974.                 if (TouchInput.isTriggered()) {
  975.                         var point = new Point(TouchInput.x, TouchInput.y);
  976.                         if (!!this._controlButton) {
  977.                                 if (this._controlButton.containsPoint(point)) {
  978.                                         return;
  979.                                 }
  980.                         }
  981.                         if (this._directionalPad) {
  982.                                 if (this._directionalPad.active && this._directionalPad.containsPoint(point)) {
  983.                                         return;
  984.                                 }
  985.                         }
  986.                         if (this._keyButtons) {
  987.                                 if (Object.keys(this._keyButtons).some(function (a) {
  988.                                         return _this6._keyButtons[a].containsPoint(point);
  989.                                 })) {
  990.                                         return;
  991.                                 }
  992.                         }
  993.                 }
  994.                 Alias.Scene_Map_processMapTouch.call(this);
  995.         };

  996.         //=============================================================================
  997.         // Window_Selectable
  998.         //=============================================================================
  999.         // Disable Touch Input on selectable windows if configured in the parameters.
  1000.         //=============================================================================

  1001.         Alias.Window_Selectable_processTouch = Window_Selectable.prototype.processTouch;
  1002.         Window_Selectable.prototype.processTouch = function () {
  1003.                 if (Parameters['disableTouchWindows'].contains(SceneManager._scene.constructor.name)) {
  1004.                         return;
  1005.                 }
  1006.                 Alias.Window_Selectable_processTouch.call(this);
  1007.         };

  1008.         //=============================================================================
  1009.         // Window_Message
  1010.         //=============================================================================
  1011.         // Control UI visibility when the dialogue window is activated.
  1012.         //=============================================================================

  1013.         Alias.Window_Message_startMessage = Window_Message.prototype.startMessage;
  1014.         Window_Message.prototype.startMessage = function () {
  1015.                 SceneManager._scene.hideMobileUI();
  1016.                 Alias.Window_Message_startMessage.call(this);
  1017.         };

  1018.         Alias.Window_Message_terminateMessage = Window_Message.prototype.terminateMessage;
  1019.         Window_Message.prototype.terminateMessage = function () {
  1020.                 Alias.Window_Message_terminateMessage.call(this);
  1021.                 if (SceneManager._scene._controlButton && SceneManager._scene._controlButton._buttonsHidden) {
  1022.                         SceneManager._scene._controlButton.show();
  1023.                 } else {
  1024.                         SceneManager._scene.showMobileUI();
  1025.                 }
  1026.         };

  1027.         //=============================================================================
  1028.         // Game_Interpreter
  1029.         //=============================================================================
  1030.         // Plugin commands
  1031.         //=============================================================================

  1032.         Alias.Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;
  1033.         Game_Interpreter.prototype.pluginCommand = function (command, args) {
  1034.                 Alias.Game_Interpreter_pluginCommand.call(this, command, args);
  1035.                 if (command.toLowerCase() === "mobileui") {
  1036.                         var scene = SceneManager._scene;
  1037.                         switch (args[0].toLowerCase()) {
  1038.                                 case "hide":
  1039.                                         switch (args[1].toLowerCase()) {
  1040.                                                 case "dpad":
  1041.                                                         if (scene._directionalPad) {
  1042.                                                                 if (args[2] && args[2].toLowerCase() === 'instant') {
  1043.                                                                         scene._directionalPad.hideInstant();
  1044.                                                                 } else {
  1045.                                                                         scene._directionalPad.hide();
  1046.                                                                 }
  1047.                                                         }
  1048.                                                         break;
  1049.                                                 case "control":
  1050.                                                         if (scene._controlButton) {
  1051.                                                                 if (args[2] && args[2].toLowerCase() === 'instant') {
  1052.                                                                         scene._controlButton.hideInstant();
  1053.                                                                 } else {
  1054.                                                                         scene._controlButton.hide();
  1055.                                                                 }
  1056.                                                         }
  1057.                                                         break;
  1058.                                                 default:
  1059.                                                         if (scene._keyButtons[args[1].toLowerCase()]) {
  1060.                                                                 if (args[2] && args[2].toLowerCase() === 'instant') {
  1061.                                                                         scene._keyButtons[args[1].toLowerCase()].hideInstant();
  1062.                                                                 } else {
  1063.                                                                         scene._keyButtons[args[1].toLowerCase()].hide();
  1064.                                                                 }
  1065.                                                         }
  1066.                                                         break;
  1067.                                         }
  1068.                                         break;
  1069.                                 case "show":
  1070.                                         switch (args[1].toLowerCase()) {
  1071.                                                 case "dpad":
  1072.                                                         if (scene._directionalPad) {
  1073.                                                                 if (args[2] && args[2].toLowerCase() === 'instant') {
  1074.                                                                         scene._directionalPad.showInstant();
  1075.                                                                 } else {
  1076.                                                                         scene._directionalPad.show();
  1077.                                                                 }
  1078.                                                         }
  1079.                                                         break;
  1080.                                                 case "control":
  1081.                                                         if (scene._controlButton) {
  1082.                                                                 if (args[2] && args[2].toLowerCase() === 'instant') {
  1083.                                                                         scene._controlButton.showInstant();
  1084.                                                                 } else {
  1085.                                                                         scene._controlButton.show();
  1086.                                                                 }
  1087.                                                         }
  1088.                                                         break;
  1089.                                                 default:
  1090.                                                         if (scene._keyButtons[args[1].toLowerCase()]) {
  1091.                                                                 if (args[2] && args[2].toLowerCase() === 'instant') {
  1092.                                                                         scene._keyButtons[args[1].toLowerCase()].showInstant();
  1093.                                                                 } else {
  1094.                                                                         scene._keyButtons[args[1].toLowerCase()].show();
  1095.                                                                 }
  1096.                                                         }
  1097.                                                         break;
  1098.                                         }
  1099.                                         break;
  1100.                         }
  1101.                 }
  1102.         };
  1103. })();
复制代码


Capture.PNG
Capture2.PNG
Capture3.PNG

功能:
這個插件可以創建3種不同類型的按鈕:

1.)定向墊

    單張圖片,用於向上,向左,向右和向下移動。
    可以定義此按鈕出現的場景。
    此按鈕是可選的。

2.)按鍵

    這些按鈕可用於表示任何鍵。使用的常用鍵是“ok”,“escape”,“pagedown”,“pageup”。
    這些可以是任何密鑰,並且可以有開發人員想要的那麼多或幾個。
    此外,可以單獨控制這些按鈕出現的場景。
    您還可以編寫在按下按鈕時運行的自定義代碼!
    這可以與其他插件(如Yanfly Button Common Events)結合使用,從虛擬按鈕調用公共事件。
    您可以指定此按鈕響應的輸入類型:
        觸發:按下時執行一次(默認)
        按下:按下時執行每一幀
        重複:24幀後,按下時每6幀執行一次
        長按:24幀後,按下時執行每一幀
        發布:釋放按鈕時執行一次

3.)控制按鈕

    按下控制按鈕將折疊並隱藏屏幕上的所有其他按鈕。
    如果再次按下,它將展開並顯示屏幕上的所有其他按鈕。
    這允許玩家在使用Mobile UI按鈕或標準觸摸輸入之間做出決定。
    可以定義此按鈕出現的場景。
    此按鈕是可選的。
回复

使用道具 举报

梦石
0
星屑
626
在线时间
300 小时
注册时间
2018-7-28
回帖
160
 楼主| 发表于 2019-5-2 13:35:47 | 显示全部楼层
空山鸣涧 发表于 2019-5-2 00:43
https://rpg.blue/thread-398713-1-1.html
这个?

这个我看过,菜单那些不能用
菜鸟一只
回复

使用道具 举报

梦石
0
星屑
626
在线时间
300 小时
注册时间
2018-7-28
回帖
160
 楼主| 发表于 2019-5-2 13:36:24 | 显示全部楼层
Fan723 发表于 2019-5-2 09:54
这个可以在菜单、地图、战斗场景使用:
https://rpg.blue/thread-410350-1-7.html

用在自己的游戏里面没用啊
菜鸟一只
回复

使用道具 举报

梦石
0
星屑
626
在线时间
300 小时
注册时间
2018-7-28
回帖
160
 楼主| 发表于 2019-5-2 14:00:41 | 显示全部楼层
tseyik 发表于 2019-5-2 10:36
https://forums.rpgmakerweb.com/index.php?threads/virtual-buttons-and-dpad.94196/
[fold=Virtual Butto ...

大佬。这样是什么问题。。。。
360截图187705237255100.jpg
360截图17290503465085.jpg
菜鸟一只
回复

使用道具 举报

梦石
0
星屑
626
在线时间
300 小时
注册时间
2018-7-28
回帖
160
 楼主| 发表于 2019-5-4 18:54:52 | 显示全部楼层
tseyik 发表于 2019-5-2 19:40
建立:
該設置需要在項目的img文件夾中創建一個新文件夾。 此文件夾必須命名為“mobileUI”。 下面是一個 ...



大佬,我弄了好久还是不会 。问几个问题,

1.那个大佬插件中所用到图片,他是单独分每张还是就用你前面发的那个很多图标的那一张图片。。。

2.我百度翻译每个翻译这看了下,设置那些差不多都理解了。就是我不懂事我设置问题还是插件问题,

我不管设置没设置图片打开游戏都出现
cannot read property ‘activescenes’ of undefined(我百度翻译是  无法读取未定义的属性“activescenes”  )
。
3,不懂是不是插件问题。我是把你发的那段代码直接复制,用nopepad++打开,黏贴复制直接改格式的,
我也不知道这样对不对...........




点评

大佬,还是这个个cannot read property ‘activescenes’ of undefined错误。这个是什么插件问题还是什么啊  发表于 2019-5-4 21:22
单独分每张  发表于 2019-5-4 20:44
菜鸟一只
回复

使用道具 举报

梦石
0
星屑
22879
在线时间
8598 小时
注册时间
2011-12-31
回帖
3270
发表于 2019-5-5 15:06:13 | 显示全部楼层
本帖最后由 tseyik 于 2019-5-5 15:08 编辑

你開一個新專案
Project11.zip (908.34 KB, 下载次数: 283)
然後用這個替代;mobileUI放在img文件夾
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部