Problem with fullscreen

Hi guys, I'm noob with RPG MAKER MV and I don't understand why I get those black edges on the sides. Does anyone know how to remove them?

1641155040251.png


This image is my full screen
Sin título.png


This not work for me
The aspect ratio of your game doesn't match the aspect ratio of your screen. That's why you get black borders.

You have multiple ways to fix this:
  • Change the game's resolution to match the screen's aspect ratio. In your case, the aspect ratio is 16:9.

    You'll need to optimize your UI to the new aspect ration, and this would only work for screens that have the same aspect ratio. Some people have ultrawide screens with aspect ratio of 32:9, some have cinematic wide screens with aspect ratio 21:9, some may have old 16:10 screens, others even older 4:3 or 5:4 screens, and there are also exotic aspect ratios like 3:2, 2:1, and so on.


  • Make your game resolution-independent.

    Similar to the above solution, but instead of choosing a fixed resolution, you let your game choose its resolution based on the screen's resolution.

    Since you don't know what resolution your game will use, you'll need to make your UI resolution-independent too. You'll need to rewrite large parts of the RPG Maker MV code, and it's extremely hard to get right.


  • Force the game to stretch.

    This can easily be done with CSS. Simply add the following line to the index.html file somewhere inside the <head> tag:
    HTML:
    <style>canvas { width: 100% !important; height: 100% !important; }</style>

    The <head> tag of your index.html file would look similar to this:
    HTML:
        <head>
            <meta charset="UTF-8">
            <meta name="apple-mobile-web-app-capable" content="yes">
            <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
            <meta name="viewport" content="user-scalable=no">
            <link rel="icon" href="icon/icon.png" type="image/png">
            <link rel="apple-touch-icon" href="icon/icon.png">
            <link rel="stylesheet" type="text/css" href="fonts/gamefont.css">
            <style>canvas { width: 100% !important; height: 100% !important; }</style>
            <title>Game Title</title>
        </head>

    Note that most people dislike stretched graphics, as it does not look good.

    For those that would like to use this solution but use RPG Maker MZ instead, you don't need to mess with the index.html file, and can instead use the game.css file inside the css folder. Simply add following lines anywhere in the file:
    CSS:
    canvas {
        width: 100% !important;
        height: 100% !important;
    }
Double-post notice: @LinkRPG

Note that just because you have black borders doesn't mean other people playing your game will have black borders. It will be different for everyone. So if you add a solution to the game itself to make it work for you, you might make it weird for your players.
The aspect ratio of your game doesn't match the aspect ratio of your screen. That's why you get black borders.

You have multiple ways to fix this:
  • Change the game's resolution to match the screen's aspect ratio. In your case, the aspect ratio is 16:9.

    You'll need to optimize your UI to the new aspect ration, and this would only work for screens that have the same aspect ratio. Some people have ultrawide screens with aspect ratio of 32:9, some have cinematic wide screens with aspect ratio 21:9, some may have old 16:10 screens, others even older 4:3 or 5:4 screens, and there are also exotic aspect ratios like 3:2, 2:1, and so on.


  • Make your game resolution-independent.

    Similar to the above solution, but instead of choosing a fixed resolution, you let your game choose its resolution based on the screen's resolution.

    Since you don't know what resolution your game will use, you'll need to make your UI resolution-independent too. You'll need to rewrite large parts of the RPG Maker MV code, and it's extremely hard to get right.


  • Force the game to stretch.

    This can easily be done with CSS. Simply add the following line to the index.html file somewhere inside the <head> tag:
    HTML:
    <style>canvas { width: 100% !important; height: 100% !important; }</style>

    The <head> tag of your index.html file would look similar to this:
    HTML:
        <head>
            <meta charset="UTF-8">
            <meta name="apple-mobile-web-app-capable" content="yes">
            <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
            <meta name="viewport" content="user-scalable=no">
            <link rel="icon" href="icon/icon.png" type="image/png">
            <link rel="apple-touch-icon" href="icon/icon.png">
            <link rel="stylesheet" type="text/css" href="fonts/gamefont.css">
            <style>canvas { width: 100% !important; height: 100% !important; }</style>
            <title>Game Title</title>
        </head>

    Note that most people dislike stretched graphics, as it does not look good.

    For those that would like to use this solution but use RPG Maker MZ instead, you don't need to mess with the index.html file, and can instead use the game.css file inside the css folder. Simply add following lines anywhere in the file:
    CSS:
    canvas {
        width: 100% !important;
        height: 100% !important;
    }
Thanks a lot!!!! It works!! ALELUYAH

Double-post notice: @LinkRPG[/dp ost]

Note that just because you have black borders doesn't mean other people playing your game will have black borders. It will be different for everyone. So if you add a solution to the game itself to make it work for you, you might make it weird for your players.
Double-post notice:
Oh no! Sorry for breaking the rules!!! I'm sorry, i'm really, really sorry. It will not happen again! And a big thank you to both of you for your help.
Thanks, this worked for me
CSS:
Code:
canvas {
    width: 100% !important;
    height: 100% !important;
}

but the mobile touch remains with the previous resolution,
there will be something to correct it and also want to be full screen?


Seriously, your method is the only one that has worked for me, thank you very much
Necro-post notice: @Kollote

Original thread: https://forums.rpgmakerweb.com/threads/problem-with-fullscreen.143543/