スマホ仮想ボタンのプラグイン導入でアプリが落ちる事を回避する方法
Posted: 2016年1月13日(水) 16:22
皆さん、こんにちは。
スマホ仮想ボタンのプラグイン導入でアプリが、落ちる事を回避する方法が判ったので投稿します。
スマホ仮想ボタンのプラグインとして動くものに「MBS_MobileDirPad」と
「UCHU_MobileOperation」があります。
しかし、どちらもcrosswalk 10.39.235.16でAPKにパッケージしてAndroid4系スマホで
アプリとしてプレイすると移動や戦闘を繰り返すとアプリが、落ちてしまいます。
this変数を、scene変数に代入して関数内で使う事でメモリリークが発生するようです。
下記が、回避方法です。
MBS_MobileDirPad.jsの下記部分を、コメントアウトするとアプリが安定動作します。
// var scene = this;
// this._messageWindow.startMessage = function() {
// oldStartMessage.apply(this, arguments);
// scene.hideUserInterface();
// };
// Window_Message.prototype.terminateMessage = function() {
// oldTerminateMessage.apply(this, arguments);
// scene.showUserInterface();
// };
UCHU_MobileOperation.jsの下記部分を、コメントアウトするとアプリが安定動作します。
// var scene = this;
//
// this._messageWindow.startMessage = function() {
// oldStartMessage.apply(this, arguments);
// if($gameMessage.positionType()==2){
// scene.hideUserInterface();
// }
// };
// Window_Message.prototype.terminateMessage = function() {
// oldTerminateMessage.apply(this, arguments);
// Btn_hide=false;
// setTimeout("Scene_Base.prototype.showUserInterface();", 200);
// };
※中略
// var scene = this;
// this._messageWindow.startMessage = function() {
// oldStartMessage.apply(this, arguments);
// if($gameMessage.positionType()==2){
// scene.hideUserInterface();
// }
// };
// Window_Message.prototype.terminateMessage = function() {
// oldTerminateMessage.apply(this, arguments);
// Btn_hide=false;
// setTimeout("Scene_Base.prototype.showUserInterface();", 200);
// };
MBS_MobileDirPad
https://github.com/MaskedRpg/JS/blob/master/mv/MBS_MobileDirPad.js
UCHU_MobileOperation
http://uchuzine.x0.com/demo/download/UCHU_MobileOperation.js
以上、参考になれば幸いです。
スマホ仮想ボタンのプラグイン導入でアプリが、落ちる事を回避する方法が判ったので投稿します。
スマホ仮想ボタンのプラグインとして動くものに「MBS_MobileDirPad」と
「UCHU_MobileOperation」があります。
しかし、どちらもcrosswalk 10.39.235.16でAPKにパッケージしてAndroid4系スマホで
アプリとしてプレイすると移動や戦闘を繰り返すとアプリが、落ちてしまいます。
this変数を、scene変数に代入して関数内で使う事でメモリリークが発生するようです。
下記が、回避方法です。
MBS_MobileDirPad.jsの下記部分を、コメントアウトするとアプリが安定動作します。
// var scene = this;
// this._messageWindow.startMessage = function() {
// oldStartMessage.apply(this, arguments);
// scene.hideUserInterface();
// };
// Window_Message.prototype.terminateMessage = function() {
// oldTerminateMessage.apply(this, arguments);
// scene.showUserInterface();
// };
UCHU_MobileOperation.jsの下記部分を、コメントアウトするとアプリが安定動作します。
// var scene = this;
//
// this._messageWindow.startMessage = function() {
// oldStartMessage.apply(this, arguments);
// if($gameMessage.positionType()==2){
// scene.hideUserInterface();
// }
// };
// Window_Message.prototype.terminateMessage = function() {
// oldTerminateMessage.apply(this, arguments);
// Btn_hide=false;
// setTimeout("Scene_Base.prototype.showUserInterface();", 200);
// };
※中略
// var scene = this;
// this._messageWindow.startMessage = function() {
// oldStartMessage.apply(this, arguments);
// if($gameMessage.positionType()==2){
// scene.hideUserInterface();
// }
// };
// Window_Message.prototype.terminateMessage = function() {
// oldTerminateMessage.apply(this, arguments);
// Btn_hide=false;
// setTimeout("Scene_Base.prototype.showUserInterface();", 200);
// };
MBS_MobileDirPad
https://github.com/MaskedRpg/JS/blob/master/mv/MBS_MobileDirPad.js
UCHU_MobileOperation
http://uchuzine.x0.com/demo/download/UCHU_MobileOperation.js
以上、参考になれば幸いです。