/* @param 默认分辨率宽
* @desc 默认分辨率(宽)
* @default 816
* @param 默认分辨率高
* @desc 默认分辨率(高)
* @default 624
*/
var params = PluginManager.parameters("TX_W_changeWindowSize");
var screenWidth = Number(params["默认分辨率宽"]);
var screenHeight = Number(params["默认分辨率高"]);
setScreenSize(screenWidth, screenHeight);
var _Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;
Game_Interpreter.prototype.pluginCommand = function(command, args){
_Game_Interpreter_pluginCommand.call(this, command, args);
switch(command){
case "changeWindowSize":
var _screenWidth = Number(args[0]) || 816;
var _screenHeight = Number(args[1]) || 624;
setScreenSize(_screenWidth, _screenHeight);
break;
case "UseMVSize":
setScreenSize(816, 624);
break;
default: break;
}
}
function setScreenSize(screenWidth, screenHeight){
var deltaWidth = screenWidth - window.innerWidth;
var deltaHeight = screenHeight - window.innerHeight;
window.moveBy(- deltaWidth / 2, - deltaHeight / 2);
window.resizeBy(deltaWidth, deltaHeight);
}