Scale menu screen to make it more pixelated

I have recently bought both the RPG Maker MV and discovered that the Time Fantasy graphics I bought a while ago have MV graphics included in them as well. They are gorgeous and I'd love to use them, but they are upscaled RPG Maker Ace graphics and clash hard with the look of MV's menu screens. As the Time Fantasy MV graphics are upscaled anyway, my idea was:

1. Increase the game resolution to show more of the map and let the Time Fantasy graphics look a bit sharper and less pixelated. For example make the game resolution 1044x832.
2. Draw the window layer of the menu on a canvas of smaller size, like the 816x624. Then strech/scale that canvas to the actual screen size to make it look more pixelated. I'm not sure if it needs to be a smaller canvas - I just want to draw the whole menu on a smaller something and then scale this thing up.

Step one was easy. Step two I struggle with. I found the method WindowLayer.prototype.renderCanvas which looked promising, but changing it in a way I thought made sense had no effect. This is the piece of code I tried:

JavaScript:
    const _menuWidth = 816;
    const _menuHeight = 624;

    const alias_renderCanvas = WindowLayer.prototype.renderCanvas
    WindowLayer.prototype.renderCanvas = function(renderer) {
        let origWidth = Graphics.width;
        let origHeight = Graphics.height;
        Graphics.width = menuWidth;
        Graphics.height = menuHeight;
        alias_renderCanvas.call(this, renderer);
        Graphics.width = origWidth;
        Graphics.height = origHeight;
    };

So - how do I do this? I don't need a complete answer, even a few hints to point me in the right direction would help. I appreciate any help, really. I want a solution in code, not a plugin. But if you do know a plugin that does this - tell me anyway, then I can learn from their code. 🙂
I made some progress doing this, and I want to leave them here in case something discovers this thread via search/Google and wants to pick up where I left. My learning so far:

  • Unsurprisingly, the renderCanvas function only applies when running in canvas mode. I does nothing for webgl rendering.
  • While most of the windows have their size defined in relation to boxWidth/boxHeight, some have actually hardocded values. The left side of the menu (with the commands) for example is always 240px wide ...
  • If you scale the menus, you need to apply the same "scaling" on the touch/mouse coordinates as well, otherwise they will be off
I managed to make this thing work for canvas, but I struggle with webgl. I can make the windows scale, but they are still clipped to their original size. Also, I discovered the problem with touch/mouse, but I have not fixed it. I think those are all solvable problems, but with my currently small knowledge of WebGL/PixiJS/RMMV I figured I should start with something easier first.

As I said, I want to leave what I have so far (at least the working part), in case someone finds this and wants to continue. I created a Gist for it: https://gist.github.com/psuessenb/6392751aabbb3143d528d5be8696ca86. I left out the half-working WebGL stuff, because maybe it's leading in a totally wrong direction. If anyone finds it useful, feel free to take it.

Original thread: https://forums.rpgmakerweb.com/threads/scale-menu-screen-to-make-it-more-pixelated.105671/