丘の下の隠れ家

当ブログは、Tkool Worldの本館です。思った事や書きたいことなどを書いていきます。

RPGツクールMVで854x480の解像度を実装するやつ

お久しぶりでございます、ティークです。
ツクールMVのデフォルトの解像度が816x624なのは、MVツクラーなら知っている方もいるのではないかと思います。VXの1.5倍。
ちなみに、他のツクールでいえば2000と2003が320x240、95とXPが640x480、VXとVXAceが544x416、DSとDS+が256x192、フェスが400x240、MVTrinityのSwitch版が1248x720。PS4版も恐らく同様。

それでこの解像度、VXの時も言われてましたが4:3でも16:9でもない一般的な解像度とは程遠いものなので、気にする人はものすごい気にするんですよ。
ゲーム画面を録画して動画サイト等に上げる時も、自動でリサイズされて画質に影響が出るので、規定のサイズにするために編集時に調整しなければならないという手間が増えます。
元々編集する前提で撮ってるならまだいいんですが、そのまま上げたい方には地味に不便です。
あと、環境によっては全画面表示にした時に大きく余白が残ったり上手く処理ができなかったりでプレイヤー側としては若干やよろしくない。

「デフォルトからレイアウト変えるのめんどくせぇ」「だったらオメーよろしくなくない感じにできるやつを上げてみろよ」という方もいると思うので、
ほぼ自分用ではありますが854x480用にちょうどよくしたレイアウトに近づけるプラグイン"もどき"を作ってみました。
自分用の物を無理やり素材化したので、名前入力画面に対応してません。あとほとんどの処理が再定義なので競合率クッソ高いです。素材として使えるかどうかもまだ怪しい。
「ココの表示がおかしい」「○○と組み合わせたらエラーが出る」等といった物がありましたらご報告いただけましたら助かります。

//=============================================================================
// Tik_854x480_alpha.js
//=============================================================================
 // Copyright (c) 2015 Tieck Miyanaga
// This software is released under the MIT License.
// http://opensource.org/licenses/mit-license.php
// ----------------------------------------------------------------------------
// Version
// 1.1.0 2021/04/30 なんか色々微調整した
// 1.0.0 2019/10/05 初版
// ----------------------------------------------------------------------------
// [Twitter]: https://twitter.com/myng_windio/
//=============================================================================
/*:
 * @plugindesc Adjust the window for 854x480 and make adjustments that only I can get.
 * @author Tieck Miyanaga
 *
 * @help This plugin does not provide plugin commands.
 *
 * This plugin is released under the MIT License.
 */
 
/*:ja
 * @plugindesc 854x480用にウィンドウを調整したり、自分しか得しないような変更をしたりしなかったりします。
 * @author 宮永ティーク
 *
 *@help プラグインコマンド?パラメーター?そんなものはない。
 *
 * 利用規約:
 *  無断で改変、再配布も可能で、利用形態(商用、18禁利用等)についても制限はないです。クレジットも任意です。
 *  ただし「このプラグインはワシが作った」などと自作発言だけはしてはいけない(戒め)
 */
   //=============================================================================
    // 画面のシェイクの迫力がどうも薄いので改変
    //=============================================================================
Game_Screen.prototype.startShake = function(power, speed, duration) {
    this._shakePower = power*2;
    this._shakeSpeed = speed*4;
    this._shakeDuration = duration;
};
   //=============================================================================
    // テストプレイ用にセーブデータ数を無駄に増やす
    //=============================================================================
DataManager.maxSavefiles = function() {
    return 999;
};
   //=============================================================================
   //  タイトルでseもストップ
   //=============================================================================
Scene_Title.prototype.playTitleMusic = function() {
    AudioManager.playBgm($dataSystem.titleBgm);
    AudioManager.stopBgs();
    AudioManager.stopMe();
    AudioManager.stopSe();
};
   //=============================================================================
    // 拡大率の調整
    //=============================================================================

Window_Base.prototype.standardFontSize = function() {
    return 28;
};

Window_Base.prototype.lineHeight = function() {
    return 32;
};

Window_Base.prototype.makeFontBigger = function() {
    if (this.contents.fontSize <= 64) {
        this.contents.fontSize += 8;
    }
};

Window_Base.prototype.makeFontSmaller = function() {
    if (this.contents.fontSize >= 16) {
        this.contents.fontSize -= 8;
    }
};

Window_Message.prototype.numVisibleRows = function() {
    return 4.5;
};

Window_Base.prototype.standardPadding = function() {
    return 9;
};

Window_Base.prototype.textPadding = function() {
    return 1.5;
};

Window_Message.prototype.newPage = function(textState) {
    this.contents.clear();
    this.resetFontSettings();
    this.clearFlags();
    this.loadMessageFace();
    textState.x = this.newLineX();
    textState.y = -6;
    textState.left = this.newLineX();
    textState.height = this.calcTextHeight(textState, false);
   //=============================================================================
   // 854x480に合わせて項目のデカさも若干調整だ!
   //=============================================================================
Window_Help.prototype.initialize = function(numLines) {
    var width = Graphics.boxWidth;
    var height = this.fittingHeight(numLines || 2.5);
    Window_Base.prototype.initialize.call(this, 0, 0, width, height);
    this._text = '';
};

Window_SavefileList.prototype.maxVisibleItems = function() {
    return 4;
};

Window_ShopStatus.prototype.pageSize = function() {
    return 3;
};

Window_Gold.prototype.windowWidth = function() {
	return 200;
};

 
Window_Command.prototype.windowWidth = function() {
    return 200;
};
  
Window_SkillType.prototype.numVisibleRows = function() {
    return 2;
};

Window_EquipStatus.prototype.numVisibleRows = function() {
    return 6;
};
   //=============================================================================
   // ステータスウィンドウ、もっと敷き詰めても良いと思うんだ。
   // あとVXA以降の運はXPの器用さよりいらない。再定義だけじゃ消せないのほんとひで
   //=============================================================================

Window_Status.prototype.refresh = function() {
    this.contents.clear();
    if (this._actor) {
        var lineHeight = this.lineHeight();
        this.drawBlock1((lineHeight+1) * 0);
        this.drawHorzLine((lineHeight+1) * 0.50);
        this.drawBlock2((lineHeight+1) * 1.00);
        this.drawHorzLine((lineHeight+1) * 5.00);
        this.drawBlock3((lineHeight+1) * 5.50);
        this.drawHorzLine((lineHeight+1) * 11.00);
        this.drawBlock4((lineHeight+1) * 11.75);
    }
};

Window_Status.prototype.drawBlock1 = function(y) {
    this.drawActorName(this._actor, 6, y);
    this.drawActorClass(this._actor, 200, y);
    this.drawActorNickname(this._actor, 402, y);
};

Window_Status.prototype.drawBlock2 = function(y) {
    this.drawActorFace(this._actor, 32, y);
    this.drawBasicInfo(200, y);
    this.drawExpInfo(402, y);
};

Window_Status.prototype.drawBlock3 = function(y) {
    this.drawParameters(32, y);
    this.drawEquipments(288, y);
};

Window_Status.prototype.drawBlock4 = function(y) {
    this.drawProfile(4, y);
};

Window_Status.prototype.drawHorzLine = function(y) {
    var lineY = y + this.lineHeight() / 2 - 1;
    this.contents.paintOpacity = 48;
    this.contents.fillRect(0, lineY, this.contentsWidth(), 2, this.lineColor());
    this.contents.paintOpacity = 255;
};

Window_Status.prototype.drawBasicInfo = function(x, y) {
    var lineHeight = this.lineHeight();
    this.drawActorLevel(this._actor, x, y + lineHeight * 0);
    this.drawActorIcons(this._actor, x, y + lineHeight * 1);
    this.drawActorHp(this._actor, x, y + lineHeight * 1.5);
    this.drawActorMp(this._actor, x, y + lineHeight * 2.5);
};

Window_Status.prototype.drawParameters = function(x, y) {
    var lineHeight = this.lineHeight();
    for (var i = 0; i < 5; i++) {
        var paramId = i + 2;
        var y2 = y + lineHeight * i;
        this.changeTextColor(this.systemColor());
        this.drawText(TextManager.param(paramId), x, y2, 160);
        this.resetTextColor();
        this.drawText(this._actor.param(paramId), x + 160, y2, 60, 'left');
    }
};

Window_Status.prototype.drawExpInfo = function(x, y) {
    var lineHeight = this.lineHeight();
    var expTotal = TextManager.expTotal.format(TextManager.exp);
    var expNext = TextManager.expNext.format(TextManager.level);
    var value1 = this._actor.currentExp();
    var value2 = this._actor.nextRequiredExp();
    if (this._actor.isMaxLevel()) {
        value1 = '-------';
        value2 = '-------';
    }
    this.changeTextColor(this.systemColor());
    this.drawText(expTotal, x, y + lineHeight * 0, 180);
    this.drawText(expNext, x, y + lineHeight * 2/1.5, 180);
    this.resetTextColor();
    this.drawText(value1, x, y + lineHeight * 1/1.5, 180, 'right');
    this.drawText(value2, x, y + lineHeight * 3/1.5, 180, 'right');
};

Window_Status.prototype.maxEquipmentLines = function() {
    return 5;
};

//Window_MenuStatus.prototype.windowWidth = function() {
//   return Graphics.boxWidth - 200;
//};

Window_MenuStatus.prototype.numVisibleRows = function() {
    return 3;
};

//Window_MenuCommand.prototype.windowWidth = function() {
 //   return 200;
//};

Window_Options.prototype.volumeOffset = function() {
    return 5;
};

Window_TitleCommand.prototype.updatePlacement = function() {
    this.x = (Graphics.boxWidth - this.width) / 2;
this.y = (Graphics.boxHeight * 1.3 - this.height) / 2;
};
   //=============================================================================
   // マップ名の表示を自分好みに。
   //=============================================================================
Window_MapName.prototype.windowWidth = function() {
    return 854;
};
  //=============================================================================
  // クリティカルで3倍はダメだ、せめて2倍にしろ。
  //=============================================================================
Game_Action.prototype.applyCritical = function(damage) {
    return damage * 2;
};
  //=============================================================================
  // もちろん顔グラも詰めます。
  // 最大文字数もちょっとだけ増えるよ!やったね!
  //=============================================================================
Window_Message.prototype.newLineX = function() {
    return $gameMessage.faceName() === '' ? 0 : 144;
};
//=============================================================================
// 戦闘アニメもったりしすぎだろ!!
// もっとスマートに2倍速してくれよ!!
//=============================================================================
Sprite_Animation.prototype.setupRate = function() {
    this._rate = 2;
};

//=============================================================================
// VXAceで効果があった軽量化を擬似的に実装。
// 効果が実感できる物と別にそうでもなさそうな物の違いは正直分かりません。
// 参考元: http://vxace.hatenablog.com/entry/2013/03/24/164046
// 参考元: https://note.mu/aebafuti/n/n0ec8e9e02a7b
//=============================================================================
 Sprite_Character.prototype.isNearTheScreen = function() {
    var gw = Graphics.width;
    var gh = Graphics.height;
    var tw = $gameMap.tileWidth();
    var th = $gameMap.tileHeight();
    var px = this.scrolledX() * tw + tw / 2 - gw / 2;
    var py = this.scrolledY() * th + th / 2 - gh / 2;
    return px >= -gw && px <= gw && py >= -gh && py <= gh;
};

Sprite_Character.prototype.update = function() {
    Sprite_Base.prototype.update.call(this);
    this.updateBitmap();
    this.updateFrame();
    this.updatePosition();
    this.updateAnimation();
    this.updateBalloon();
    this.updateOther();
	return !!this._isNearTheScreen;
};

Game_Map.prototype.updateEvents = function() {
   this.events().forEach(function(event) {
       if(event.isNearThePlayer()) event.update();
   });
   this._commonEvents.forEach(function(event) {
       event.update();
   });
};
  //=============================================================================
  // トランジション?
  //うるせ~~~!!!!!!
  //いらね~~~~~~~~~~~~~~!!!!!
  //FINAL FANT
  //            ASY
  //=============================================================================
Scene_Map.prototype.encounterEffectSpeed = function() {
return 0;
};