【RPG Maker MV插件】【MND_ChangeScreenSize】改變游戲屏幕分辨率

這個(gè)插件是參考了Yanfly的YEP_CoreEngine寫的,YEP_CoreEngine功能多文件也大,如果不使用YEP系列插件,單單想要改變屏幕分辨率,用YEP_CoreEngine顯然是牛刀殺雞,浪費(fèi)資源。
  插件安裝后只需要配置一下所要的屏幕寬、高尺寸即可,效果和YEP的一樣。
  插件完整代碼:

/*:
 * ===============================
 * MND_ChangeScreenSize.js
 * =============================== 
 * @plugindesc 修改游戲屏幕分辨率
 * @author 萵瓜 @66rpg
 * 
 * @param Screen Width
 * @desc 屏幕寬度
 * @default 816
 * 
 * @param Screen Height
 * @desc 屏幕高度
 * @default 624
 * 
 * @help
 * 配置 Screen Width 和 Screen Height 即可。
 *
 * by 鰻駝螺(Mandarava) 2016.06.06
 */

(function(){
    var params=PluginManager.parameters("MND_ChangeScreenSize");
    var screenWidth=Number(params["Screen Width"]);
    var screenHeight=Number(params["Screen Height"]);

    SceneManager._screenWidth  = screenWidth;
    SceneManager._screenHeight = screenHeight;
    SceneManager._boxWidth     = screenWidth;
    SceneManager._boxHeight    = screenHeight;

    var newWidth = screenWidth - window.innerWidth;
    var newHeight = screenHeight - window.innerHeight;  
    window.moveBy(- newWidth / 2, - newHeight / 2);
    window.resizeBy(newWidth, newHeight);
})();
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容