查看: 3695|回复: 3

[已经过期] 能否让这个虚拟按键插件在游戏中途才开启?

[复制链接]
梦石
0
星屑
50
在线时间
18 小时
注册时间
2015-8-3
回帖
8
发表于 2016-2-28 11:02:10 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 余烬之中 于 2016-8-4 12:02 编辑

就是在刚进游戏时先不显示
  1. //=============================================================================
  2. // UCHU_MobileOperation.js
  3. // Version: 1.0.0
  4. //=============================================================================

  5. /*:
  6. @plugindesc
  7. スマホ操作用プラグイン。横持ち/縦持ちに対応した仮想ボタン、
  8. タッチ操作の方法を追加拡張し、スマホプレイを快適にします。
  9. @author
  10. uchuzine
  11. @help
  12. UCHU_MobileOperation (Version: 1.0.0)
  13. ------------------------------------------------------------------------------
  14. ■特徴
  15. ------------------------------------------------------------------------------
  16. プラグイン作成にあたり、por Masked氏のMBS_MobileDirPad.jsを参考にしています。

  17. ○本プラグインの特徴
  18. ・ゲーム画面外(黒帯部分)にボタンを設置するため、プレイ画面に干渉しにくい
  19. ・パッドやボタンは個別に表示/非表示の切り替えが可能
  20. ・ボタンの基準点を画面四隅のいずれかに指定でき、縦持ち操作に対応可能
  21. ・方向パッドの操作性を重視し、タッチ判定領域、斜め方向の感度など調整可能
  22.  (詳細は下記の説明を参照)
  23. ・方向パッドによる移動と、デフォルトの目的地タッチによる移動を併用可能
  24. ・特定のタッチ操作、ジェスチャーによるボタン操作の拡張

  25. これらを利用し、

  26. ・仮想十字キーは使わずに、MENUボタンと決定ボタンのみ使用
  27. ・ボタンは全て使用せず、画面長押しでオート連打、画面外タッチでメニュー呼出

  28. といった使い方もできます。

  29. ------------------------------------------------------------------------------
  30. ■一部のパラメータの説明
  31. ------------------------------------------------------------------------------
  32. ▼ DPad OpelationRange(方向パッド作動領域)‥‥
  33. 方向パッド画像の表示サイズに対する、タッチ判定領域の大きさを倍率で指定します。
  34. 数値を上げても見た目は変わりませんが、画像の中心から外側に判定が広がります。
  35. 例)
  36. 「1」のとき‥‥画像のサイズがタッチ判定の大きさになる(画像の内接円の中のみ)
  37. 「2」のとき‥‥タッチ判定の大きさが縦横2倍になる(画像の外側に50%ずつ広がる)

  38. 数値を上げることで操作ミスを防ぎ、操作性を上げることができますが
  39. 上げ過ぎて他のボタン等に重なってしまわないように注意してください。

  40. ▼ DPad DiagonalRange(方向パッドの斜め方向範囲)‥‥
  41. 方向の判定は、パッド画像の対角線を境界線にして上下左右に分けていますが、
  42. この数値を上げると、対角線上をタッチしたときにその両側の方向がオンになり
  43. (「右」+「上」など)、8方向判定ができるようになります。
  44. 8方向移動のプラグインを使用している時などは、この数値を設定してください。

  45. 数値の大きさが斜め判定角度の広さとなり、「0~1」の範囲で指定します
  46. 例)
  47. 「0」のとき‥‥上下左右の4方向のみ入力可能。
  48. 「0.5」のとき‥均等8分割の8方向入力が可能。
  49. 「1」のとき‥‥「右上」「右下」「左上」「左下」の4方向入力。

  50. 数値を上げるほど、「上を押すつもりが右上になっていた」等のミスが起こるため
  51. 4方向で問題ない場合は、「0」を指定すると操作ミスが最小限になります。

  52. ------------------------------------------------------------------------------
  53. ■パッド、ボタン画像について
  54. ------------------------------------------------------------------------------
  55. ・画像ファイルは任意のサイズで作成可能ですが、縦横比1:1で作成してください。
  56.  表示の際は、「DPad Size」で指定したpixel数にリサイズされます。
  57.  ボタン画像も同様です。
  58. ・方向パッドのグラフィックの中心が画像の中心になるようにしてください。



  59. @param ---PC Option---
  60. @default

  61. @param PC BtnDisplay
  62. @desc PCで実行時も、仮想ボタンを表示する:true しない:false
  63. 初期値:false
  64. @default false

  65. @param PC TouchExtend
  66. @desc PCで実行時も、タッチの操作拡張を有効にする:true しない:false
  67. 初期値:true;
  68. @default true

  69. @param ---File Path---
  70. @default

  71. @param DPad Image
  72. @desc 方向パッド画像のファイルパス
  73. @default ./img/system/DirPad.png

  74. @param ActionBtn Image
  75. @desc 決定ボタン画像のファイルパス
  76. @default ./img/system/ActionButton.png

  77. @param CancelBtn Image
  78. @desc キャンセル(メニュー)ボタン画像のファイルパス
  79. @default ./img/system/CancelButton.png

  80. @param ---Button Customize---
  81. @default

  82. @param Button Opacity
  83. @desc ボタンの不透明度(0~1) 初期値:0.7
  84. @default 0.7

  85. @param Vertical BtnZoom
  86. @desc スマホ縦持ちで表示したときの全ボタンの拡大率
  87. 初期値:1.7
  88. @default 1.7

  89. @param Tablet BtnZoom
  90. @desc タブレット横持ちで表示したときの全ボタンの拡大率
  91. 初期値:0.8
  92. @default 0.8

  93. @param TabVertical BtnZoom
  94. @desc タブレット縦持ちで表示したときの全ボタンの拡大率
  95. 初期値:1.1
  96. @default 1.1

  97. @param HideButton OnMessage
  98. @desc 画面下部にメッセージ表示時、仮想ボタンの表示順位をゲーム画面の下に下げる:true そのまま:false
  99. 初期値:true
  100. @default true

  101. @param DPad Visible
  102. @desc 方向パッドを表示する:true しない:false  初期値:true
  103. @default true

  104. @param DPad Size
  105. @desc 方向パッドの大きさ(px)。 初期値:200
  106. @default 200

  107. @param DPad Margin
  108. @desc 方向パッド画像の位置。画面端からの隙間の大きさで指定。
  109. (左からの幅; 下からの幅) 初期値:10; 10
  110. @default 10; 10

  111. @param DPad Orientation
  112. @desc 方向パッドの基準位置を、左下以外に変えたい場合。
  113. left か right; top か bottom で指定。 初期値:left; bottom
  114. @default left; bottom

  115. @param DPad OpelationRange
  116. @desc 方向パッド画像に対する、タッチの作動範囲(倍率、1~)
  117. 画像の外側にタッチ判定を広げ、操作ミスを防ぐ。初期値:1.3
  118. @default 1.3

  119. @param DPad DiagonalRange
  120. @desc 方向パッド斜め方向の判定の広さ(0~1)。斜めに入りやすくする程、操作がブレやすくなる。4方向でよい場合は0に。初期値:0.3;
  121. @default 0.3

  122. @param ActionBtn Visible
  123. @desc 決定ボタンを表示する:true しない:false  初期値:true
  124. @default true

  125. @param ActionBtn Size
  126. @desc 決定ボタンの大きさ(px)。 初期値:100
  127. @default 100

  128. @param ActionBtn Margin
  129. @desc 決定ボタンの位置。画面端からの隙間の大きさで指定。
  130. (右からの幅; 下からの幅) 初期値:10; 90
  131. @default 10; 90

  132. @param ActionBtn Orientation
  133. @desc 決定ボタンの基準位置を、右下以外に変えたい場合。
  134. left か right; top か bottom で指定。 初期値:right; bottom
  135. @default right; bottom

  136. @param CancelBtn Visible
  137. @desc キャンセル(メニュー)ボタンを表示する:true しない:false
  138. 初期値:true
  139. @default true

  140. @param CancelBtn Size
  141. @desc キャンセルボタンの大きさ(px)。 初期値:100
  142. @default 100

  143. @param CancelBtn Margin
  144. @desc キャンセルボタンの位置。画面端からの隙間の大きさで指定。
  145. (右からの幅; 下からの幅) 初期値:110; 10
  146. @default 110; 10

  147. @param CancelBtn Orientation
  148. @desc キャンセルボタンの基準位置を、右下以外に変えたい場合。
  149. left か right; top か bottomで指定。 初期値:right; bottom
  150. @default right; bottom


  151. @param ---TouchInput Extend---
  152. @default

  153. @param Flick PageUp-PageDown
  154. @desc 画面上を左右にフリックすると、PageUp/PageDown操作になる。
  155. ステータス画面でキャラを切り替えたい時などに。初期値:true
  156. @default true

  157. @param HoldCanvas ActionBtn
  158. @desc 画面を長押しすると、決定ボタンを押した状態になる。
  159. 初期値:true
  160. @default true

  161. @param OutCanvas CancelBtn
  162. @desc ゲーム画面外の黒帯部分全体が、キャンセルボタン扱いになる。
  163. 初期値:false
  164. @default false

  165. @param OutCanvas ActionBtn
  166. @desc ゲーム画面外の黒帯部分全体が、決定ボタン扱いになる。
  167. 初期値:false
  168. @default false
  169. */

  170. var Imported = Imported || {};
  171. Imported.UCHU_MobileOperation = "1.0.0";

  172. var UCHU_MobileOperation = {};

  173. (function() {
  174.     "use strict";
  175.        
  176.         //-----------------------------------------------------------------------------
  177.         // Setup
  178.        
  179.         var Parameters = PluginManager.parameters('UCHU_MobileOperation');
  180.         var PRM = PRM || {};
  181.        
  182.         PRM.url=[];
  183.         PRM.visible=[];
  184.         PRM.size=[];
  185.         PRM.pos=[];
  186.         PRM.spot=[];
  187.        
  188.         PRM.pcBtn = Boolean(Parameters["PC BtnDisplay"] === 'true' || false);
  189.         PRM.pcExt = Boolean(Parameters["PC TouchExtend"] === 'true' || false);
  190.         PRM.url[0] = String(Parameters["DPad Image"]);
  191.         PRM.url[1] = String(Parameters["ActionBtn Image"]);
  192.         PRM.url[2] = String(Parameters["CancelBtn Image"]);
  193.         PRM.opacity = Number(Parameters["Button Opacity"]);
  194.         PRM.vZoom = Number(Parameters["Vertical BtnZoom"]);
  195.         PRM.tabZoom = Number(Parameters["Tablet BtnZoom"]);
  196.         PRM.tabvZoom = Number(Parameters["TabVertical BtnZoom"]);
  197.         PRM.hideBtn = Boolean(Parameters["HideButton OnMessage"] === 'true' || false);
  198.         PRM.visible[0] = Boolean(Parameters["DPad Visible"] === 'true' || false);
  199.         PRM.size[0] = Number(Parameters["DPad Size"]);
  200.         PRM.pos[0] =Parameters["DPad Margin"].split(";");
  201.         PRM.spot[0] = Parameters["DPad Orientation"].split(";");
  202.         PRM.pad_scale = Number(Parameters["DPad OpelationRange"]);
  203.         PRM.pad_dia = Math.max(0,Math.min(1,(1-Number(Parameters["DPad DiagonalRange"]))));
  204.         PRM.visible[1] = Boolean(Parameters["ActionBtn Visible"] === 'true' || false);
  205.         PRM.size[1] = Number(Parameters["ActionBtn Size"]);
  206.         PRM.pos[1] = Parameters["ActionBtn Margin"].split(";");
  207.         PRM.spot[1] = Parameters["ActionBtn Orientation"].split(";");
  208.         PRM.visible[2] = Boolean(Parameters["CancelBtn Visible"] === 'true' || false);
  209.         PRM.size[2] = Number(Parameters["CancelBtn Size"]);
  210.         PRM.pos[2] = Parameters["CancelBtn Margin"].split(";");
  211.         PRM.spot[2] = Parameters["CancelBtn Orientation"].split(";");
  212.         PRM.flickpage = Boolean(Parameters["Flick PageUp-PageDown"] === 'true' || false);
  213.         PRM.holdaction = Boolean(Parameters["HoldCanvas ActionBtn"] === 'true' || false);
  214.         PRM.outcansel = Boolean(Parameters["OutCanvas CancelBtn"] === 'true' || false);
  215.         PRM.outaction = Boolean(Parameters["OutCanvas ActionBtn"] === 'true' || false);
  216.        
  217.         var btn_id=["DirPad","ok","escape"];
  218.         var current_zoom=1;       
  219.         var st_x = 0;
  220.         var st_y = 0;
  221.         var pad_range=PRM.size[0]*PRM.pad_scale;
  222.         var pad_size=pad_range*current_zoom/2;
  223.         var Btn_ready=false;
  224.         var Btn_hide=false;
  225.         var PressBtn=false;
  226.         var dirx=0;
  227.         var diry=0;
  228.         var autofire=false;
  229.         var hvzoom=[1, PRM.vZoom];
  230.         var ua = (function(u){
  231.           return {
  232.             Tablet:(u.indexOf("windows") != -1 && u.indexOf("touch") != -1) || u.indexOf("ipad") != -1 || (u.indexOf("android") != -1 && u.indexOf("mobile") == -1) || (u.indexOf("firefox") != -1 && u.indexOf("tablet") != -1) || u.indexOf("kindle") != -1 || u.indexOf("silk") != -1 || u.indexOf("playbook") != -1
  233.           };
  234.         })(window.navigator.userAgent.toLowerCase());

  235.         if(ua.Tablet){
  236.                 hvzoom=[PRM.tabZoom, PRM.tabvZoom];
  237.         }
  238.         if (!Utils.isMobileDevice() && !PRM.pcBtn) {PRM.visible[0]=PRM.visible[1]=PRM.visible[2]=false;}

  239.         //-----------------------------------------------------------------------------
  240.         // Locate_DirPad

  241.         function Locate_DirPad() {
  242.                 this.initialize.apply(this, arguments);
  243.         }


  244.         Locate_DirPad.prototype.initialize = function() {
  245.                 var img = new Image();
  246.                 var url = PRM.url[0];
  247.                 img.onerror = function() {Graphics.printError('DirPad Image was Not Found:',url);};
  248.                 img.src = url;
  249.                 img = null;
  250.                 this.Div = document.createElement("div");
  251.                 this.Div.id = 'Dirpad';
  252.                 this.Div.style.position = 'fixed';
  253.                 this.Div.style[PRM.spot[0][0].replace(/\s+/g, "")] = String(PRM.pos[0][0]-(pad_range-PRM.size[0])/2)+'px';
  254.                 this.Div.style[PRM.spot[0][1].replace(/\s+/g, "")] = String(PRM.pos[0][1]-(pad_range-PRM.size[0])/2)+'px';
  255.                 this.Div.style.width = pad_range+'px';
  256.                 this.Div.style.height = pad_range+'px';
  257.                 this.Div.style.opacity = PRM.opacity;
  258.                 this.Div.style.zIndex = '4';
  259.                 this.Div.style.userSelect="none";
  260.                 this.Div.style["-webkit-tap-highlight-color"]="rgba(0,0,0,0)";
  261.                 this.Div.style.background = 'url('+PRM.url[0]+') 50% 50% / '+String(Math.round(PRM.size[0]/pad_range*100))+'% no-repeat';
  262.                
  263.                 if(!Utils.isMobileDevice() && PRM.pcBtn){
  264.                         this.Div.addEventListener('mousedown', function(e) {
  265.                           dirope(e.layerX,e.layerY);PressBtn=true;
  266.                         }, false);
  267.                         this.Div.addEventListener('mouseover', function(e) {
  268.                           if(TouchInput.isPressed()){dirope(e.layerX,e.layerY);PressBtn=true;}
  269.                         }, false);
  270.                         this.Div.addEventListener('mousemove', function(e) {
  271.                           if(TouchInput.isPressed()){dirope(e.layerX,e.layerY);PressBtn=true;}
  272.                         }, false);
  273.                         this.Div.addEventListener('mouseup', function(e) {
  274.                                 disope();PressBtn=false;
  275.                         }, false);
  276.                         this.Div.addEventListener('mouseout', function(e) {
  277.                                 disope();PressBtn=false;
  278.                         }, false);       
  279.                 }
  280.                 this.Div.addEventListener('touchstart', function(e) {
  281.                         PressBtn=true;
  282.                         dirope(e.touches[0].clientX-dirx, e.touches[0].clientY-diry);
  283.                 }, false);
  284.                 this.Div.addEventListener('touchmove', function(e) {
  285.                         dirope(e.touches[0].clientX-dirx, e.touches[0].clientY-diry);
  286.                         PressBtn=true;
  287.                 }, false);
  288.                 this.Div.addEventListener('touchend', function(event) {
  289.                         disope();PressBtn=false;
  290.                 }, false);
  291.                         document.body.appendChild(this.Div);
  292.         };
  293.        
  294.         function dirope(xx,yy) {
  295.                 var touchx=(xx-pad_size)/pad_size;
  296.                 var touchy=(yy-pad_size)/pad_size;
  297.                 if(Math.sqrt(touchx*touchx+touchy*touchy)>1){disope();
  298.                 }else{
  299.                         if(touchx>Math.abs(touchy)*PRM.pad_dia){Input._currentState['right']=true;Input._currentState['left']=false;}
  300.                         else if(touchx<-Math.abs(touchy)*PRM.pad_dia){Input._currentState['left']=true;Input._currentState['right']=false;}
  301.                         else{Input._currentState['left']=false;Input._currentState['right']=false;}
  302.                         if(touchy>Math.abs(touchx)*PRM.pad_dia){Input._currentState['down']=true;Input._currentState['up']=false;}
  303.                         else if(touchy<-Math.abs(touchx)*PRM.pad_dia){Input._currentState['up']=true;Input._currentState['down']=false;}
  304.                         else{Input._currentState['up']=false;Input._currentState['down']=false;}
  305.                 }
  306.         }
  307.         function disope() {
  308.                 Input._currentState['up']=false;
  309.                 Input._currentState['down']=false;
  310.                 Input._currentState['left']=false;
  311.                 Input._currentState['right']=false;
  312.         }
  313.        
  314.         //-----------------------------------------------------------------------------
  315.         // Locate_Button

  316.         function Locate_Button() {
  317.                 this.initialize.apply(this, arguments);
  318.         }
  319.         Locate_Button.prototype.initialize = function(type) {
  320.                 var img = new Image();
  321.                 var url = PRM.url[type];
  322.                 img.onerror = function() {Graphics.printError('Button Image was Not Found:',url);};
  323.                 img.src = url;
  324.                 img = null;
  325.                 this.Div = document.createElement("div");
  326.                 this.Div.id = btn_id[type]+'Btn';
  327.                 this.Div.style.position = 'fixed';
  328.                 this.Div.style[PRM.spot[type][0].replace(/\s+/g, "")] = PRM.pos[type][0]+'px';
  329.                 this.Div.style[PRM.spot[type][1].replace(/\s+/g, "")] = PRM.pos[type][1]+'px';
  330.                 this.Div.style.width = PRM.size[type]+'px';
  331.                 this.Div.style.height = PRM.size[type]+'px';
  332.                 this.Div.style.opacity = PRM.opacity;
  333.                 this.Div.style.zIndex = '4';
  334.                 this.Div.style.userSelect="none";
  335.                 this.Div.style.background = 'url('+PRM.url[type]+') 0 0 / cover no-repeat';
  336.                
  337.                 if(!Utils.isMobileDevice() && PRM.pcBtn){
  338.                         this.Div.addEventListener('mousedown', function(e) {
  339.                                 Input._currentState[btn_id[type]] = true;PressBtn=true;
  340.                         }, false);
  341.                         this.Div.addEventListener('mouseover', function(e) {
  342.                           if(TouchInput.isPressed()){Input._currentState[btn_id[type]] = true;PressBtn=true;return false;}
  343.                         }, false);
  344.                         this.Div.addEventListener('mouseup', function(e) {
  345.                           Input._currentState[btn_id[type]] = false;PressBtn=false;
  346.                         }, false);
  347.                         this.Div.addEventListener('mouseout', function(e) {
  348.                           Input._currentState[btn_id[type]] = false;PressBtn=false;
  349.                         }, false);
  350.                 }
  351.                
  352.                 this.Div.addEventListener('touchstart', function(e) {
  353.                         Input._currentState[btn_id[type]] = true;PressBtn=true;
  354.                 }, false);
  355.                 this.Div.addEventListener('touchend', function(e) {
  356.                         Input._currentState[btn_id[type]] = false;PressBtn=false;
  357.                 }, false);
  358.                
  359.                 document.body.appendChild(this.Div);
  360.         };       

  361.         //-----------------------------------------------------------------------------
  362.         // Replace function
  363.                        
  364.         var Scene_Base_start = Scene_Base.prototype.start;
  365.         Scene_Base.prototype.start = function() {
  366.                 Scene_Base_start.apply(this, arguments);
  367.             if (Utils.isMobileDevice() || PRM.pcBtn) {
  368.                         if(!Btn_ready){
  369.                                 Btn_ready=true;
  370.                                 if(PRM.visible[0]){this.DirPad = new Locate_DirPad();}
  371.                                 if(PRM.visible[1]){this.okButton = new Locate_Button(1);}
  372.                                 if(PRM.visible[2]){this.canselButton = new Locate_Button(2);}
  373.                                 Graphics._updateRealScale();
  374.                                 document.documentElement.style["-webkit-user-select"]="none";
  375.                                 document.addEventListener("touchmove", function(evt) {evt.preventDefault();}, false);
  376.                         }
  377.                 }
  378.         };
  379.                
  380.         if(PRM.visible[0] || PRM.visible[1] || PRM.visible[2]){
  381.        
  382.                 var Game_Temp_setDestination = Game_Temp.prototype.setDestination;
  383.                 Game_Temp.prototype.setDestination = function(x, y) {
  384.                         Game_Temp_setDestination.apply(this, arguments);
  385.                         if(PressBtn){
  386.                                 this._destinationX = null;
  387.                                 this._destinationY = null;
  388.                         }
  389.                 };
  390.                
  391.                 var Graphics_updateRealScale = Graphics._updateRealScale;
  392.                 Graphics._updateRealScale = function() {
  393.                         Graphics_updateRealScale.apply(this, arguments);
  394.                         if (this._stretchEnabled) {
  395.                                 if(document.getElementById("Dirpad")){
  396.                                 if(window.innerWidth<window.innerHeight){current_zoom=hvzoom[1];}else{current_zoom=hvzoom[0];}
  397.                                         pad_size=pad_range*current_zoom/2;
  398.                                         if(PRM.visible[0]){
  399.                                                 document.getElementById("Dirpad").style.zoom=current_zoom;
  400.                                                 dirx=document.getElementById("Dirpad").offsetLeft*current_zoom;
  401.                                                 diry=document.getElementById("Dirpad").offsetTop*current_zoom;
  402.                                         }
  403.                                         if(PRM.visible[1]){document.getElementById("okBtn").style.zoom=current_zoom;}
  404.                                         if(PRM.visible[2]){document.getElementById("escapeBtn").style.zoom=current_zoom;}
  405.                                 }
  406.                         }
  407.                 };
  408.         }
  409.        
  410.         //-----------------------------------------------------------------------------
  411.         // Option

  412.         if(PRM.hideBtn){
  413.                 Scene_Base.prototype.hideUserInterface = function() {
  414.                         if (Utils.isMobileDevice() || PRM.pcBtn) {Btn_hide=true;
  415.                                 if(PRM.visible[0]){document.getElementById("Dirpad").style.zIndex = '0';}
  416.                                 if(PRM.visible[1]){document.getElementById("okBtn").style.zIndex = '0';}
  417.                                 if(PRM.visible[2]){document.getElementById("escapeBtn").style.zIndex = '0';}
  418.                         }
  419.                 };
  420.                 Scene_Base.prototype.showUserInterface = function() {
  421.                         if (Utils.isMobileDevice() && !Btn_hide || PRM.pcBtn && !Btn_hide) {
  422.                                 if(PRM.visible[0]){document.getElementById("Dirpad").style.zIndex = '4';}
  423.                                 if(PRM.visible[1]){document.getElementById("okBtn").style.zIndex = '4';}
  424.                                 if(PRM.visible[2]){document.getElementById("escapeBtn").style.zIndex = '4';}
  425.                         }
  426.                 };
  427.        
  428.                 var Scene_Map_createMessageWindows = Scene_Map.prototype.createMessageWindow;
  429.                 var Scene_Map_processMapTouch = Scene_Map.prototype.processMapTouch;
  430.                 var Scene_Map_terminate = Scene_Map.prototype.terminate;
  431.                
  432.                 Scene_Map.prototype.createMessageWindow = function() {
  433.                         Scene_Map_createMessageWindows.call(this);
  434.                         var oldStartMessage = this._messageWindow.startMessage;
  435.                         var oldTerminateMessage = this._messageWindow.terminateMessage;
  436.                         var scene = this;
  437.                        
  438.                         this._messageWindow.startMessage = function() {       
  439.                                 oldStartMessage.apply(this, arguments);
  440.                                 if($gameMessage.positionType()==2){
  441.                                         scene.hideUserInterface();
  442.                                 }
  443.                         };
  444.                         Window_Message.prototype.terminateMessage = function() {
  445.                                 oldTerminateMessage.apply(this, arguments);
  446.                                 Btn_hide=false;
  447.                                 setTimeout("Scene_Base.prototype.showUserInterface();", 200);
  448.                         };
  449.                 };
  450.                
  451.                 var Scene_Battle_createMessageWindow = Scene_Battle.prototype.createMessageWindow;
  452.                 Scene_Battle.prototype.createMessageWindow = function() {
  453.                         Scene_Battle_createMessageWindow.call(this);
  454.                         var oldStartMessage = this._messageWindow.startMessage;
  455.                         var oldTerminateMessage = this._messageWindow.terminateMessage;
  456.                         var scene = this;
  457.                         this._messageWindow.startMessage = function() {
  458.                                 oldStartMessage.apply(this, arguments);
  459.                                 if($gameMessage.positionType()==2){
  460.                                         scene.hideUserInterface();
  461.                                 }
  462.                         };
  463.                         Window_Message.prototype.terminateMessage = function() {
  464.                                 oldTerminateMessage.apply(this, arguments);
  465.                                 Btn_hide=false;
  466.                                 setTimeout("Scene_Base.prototype.showUserInterface();", 200);
  467.                         };
  468.                 };
  469.         }

  470.         if(Utils.isMobileDevice() || PRM.pcExt){
  471.                
  472.                 if(PRM.holdaction){
  473.                         var TouchInput_update = TouchInput.update;
  474.                         TouchInput.update = function() {
  475.                                 TouchInput_update.apply(this, arguments);
  476.                                 if (this.isPressed()) {
  477.                                         if(PRM.holdaction && this._pressedTime==24 && !PressBtn){Input._currentState['ok']=true;autofire=true;}
  478.                                 }else if(autofire){
  479.                                         autofire=false;
  480.                                         Input._currentState['ok']=false;
  481.                                 }
  482.                         };
  483.                 }
  484.                
  485.                 if(PRM.flickpage || PRM.outcansel || PRM.outaction){
  486.                         TouchInput._endRequest= function(type) {
  487.                                 Input._currentState[type]=false;
  488.                         }
  489.                         if(Utils.isMobileDevice()){
  490.                                 var TouchInput_onTouchStart = TouchInput._onTouchStart;
  491.                                 TouchInput._onTouchStart = function(event) {
  492.                                     TouchInput_onTouchStart.apply(this, arguments);
  493.                                         var touch = event.changedTouches[0];
  494.                                         st_x = Graphics.pageToCanvasX(touch.pageX);
  495.                                         st_y = Graphics.pageToCanvasY(touch.pageY);
  496.                                     if(!PressBtn){
  497.                                                 if(st_x<0 || st_y<0 || st_x>Graphics.boxWidth || st_y>Graphics.boxHeight){
  498.                                                         if(PRM.outcansel){Input._currentState['escape']=true;setTimeout("TouchInput._endRequest('escape');", 100);}
  499.                                                         if(PRM.outaction){Input._currentState['ok']=true;setTimeout("TouchInput._endRequest('ok');", 100);}
  500.                                                 }
  501.                                         }
  502.                                 };
  503.                         }else{
  504.                                 var TouchInput_onLeftButtonDown = TouchInput._onLeftButtonDown;
  505.                                 TouchInput._onLeftButtonDown = function(event) {
  506.                                         TouchInput_onLeftButtonDown.apply(this, arguments);
  507.                                         st_x = Graphics.pageToCanvasX(event.pageX);
  508.                                         st_y = Graphics.pageToCanvasY(event.pageY);
  509.                                         if(!PressBtn){
  510.                                                 if(st_x<0 || st_y<0 || st_x>Graphics.boxWidth || st_y>Graphics.boxHeight){
  511.                                                         if(PRM.outcansel){Input._currentState['escape']=true;setTimeout("TouchInput._endRequest('escape');", 100);}
  512.                                                         if(PRM.outaction){Input._currentState['ok']=true;setTimeout("TouchInput._endRequest('ok');", 100);}
  513.                                                 }
  514.                                         }
  515.                                 };
  516.                         }
  517.                 }
  518.                        
  519.                 if(PRM.flickpage){

  520.                         var TouchInput_onMove = TouchInput._onMove;
  521.                         TouchInput._onMove = function(x, y) {
  522.                                 TouchInput_onMove.apply(this, arguments);
  523.                                 if((st_x-x)<-50 && Math.abs(st_y-y)<100 ){st_y=9999;Input._currentState['pageup']=true;setTimeout("TouchInput._endRequest('pageup');", 100);}
  524.                                 if((st_x-x)>50 && Math.abs(st_y-y)<100 ){st_y=9999;Input._currentState['pagedown']=true;setTimeout("TouchInput._endRequest('pagedown');", 100);}
  525.                         }
  526.                 }
  527.         }       
  528. })();
复制代码
梦石
0
星屑
6963
在线时间
1557 小时
注册时间
2011-6-14
回帖
425
发表于 2016-2-28 11:48:04 | 显示全部楼层
楼主求分享按键素材
回复

使用道具 举报

梦石
0
星屑
2632
在线时间
420 小时
注册时间
2016-2-3
回帖
679
发表于 2016-5-15 15:42:12 | 显示全部楼层
同求              
回复

使用道具 举报

梦石
0
星屑
15309
在线时间
720 小时
注册时间
2011-7-16
回帖
1373

开拓者

发表于 2018-8-27 12:10:48 | 显示全部楼层
这个插件看起来不错啊,加游戏里试试看
RMMV网络插件,开源免费,内含服务器端,无需强制登录,云数据,弹幕,云存档,排名,兑换码,版本检测,可自由上架下架删除。q群399090587
免打包运行MV游戏,云游戏,安卓App雷神游戏厅,在线玩游戏,上传下载游戏
开源游戏:重装机兵之重装归来【RMMV制作】全球首款按照美剧分季分集的方式发布的游戏
体素画 -- MV画3D像素图的画板
RMMV显示3D模型和场景的插件
RMMV显示spine骨骼动画的插件
RMMV秘密通道插件
突破敌群数量上限8个的插件
在rmmv中显示gif动态图片的插件
一款可以在mv游戏界面的任意位置显示任意文字的插件
RMMV Toast 插件 带物品得失提示,可以设置开启关闭 兼容yep itemcore
制作一个改名卡道具插件、调整标题页面菜单的插件、在标题页面之前显示大段文字的插件、标题页面显示版本号的插件
物品得失自动提示自动上色自动换行插件
我的Q群 663889472
另外,我的插件、范例、游戏都在这里
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部