Hello, is it possible for the RMMZ mobile game to full full-screen? because no matter how I adjust the screen it still stays the same, I like to remove the black border if possible.
Mobile game full screen
RPG Maker MZ SupportThis is "by design": on mobile browsers the height of the screen is set to 0.9 of maximum. Interestingly, rmmz_core.js has a note accompanying this section... maybe suggesting that more people wondered the same, so the devs decided to add this comment.
You'd need to overwrite this with a plugin if you want to get rid of this... saving the below as a js file and loading it as a plugin might work... I'll test it myself later today but feel free to test it yourself.
EDIT: confirmed that it works. Do be careful though not to place anything actionable at the top or bottom of the screen when getting rid of this.
JavaScript:
Graphics._stretchHeight = function() {
if (Utils.isMobileDevice()) {
// [Note] Mobile browsers often have special operations at the top and
// bottom of the screen.
const rate = Utils.isLocal() ? 1.0 : 0.9;
return document.documentElement.clientHeight * rate;
} else {
return window.innerHeight;
}
};
You'd need to overwrite this with a plugin if you want to get rid of this... saving the below as a js file and loading it as a plugin might work... I'll test it myself later today but feel free to test it yourself.
JavaScript:
(function() {
'use strict';
Graphics._stretchHeight = function() {
if (Utils.isMobileDevice()) {
return document.documentElement.clientHeight;
} else {
return window.innerHeight;
}
};
})();
EDIT: confirmed that it works. Do be careful though not to place anything actionable at the top or bottom of the screen when getting rid of this.
thank you im currently working on it now, i'll update if ive encountered a problem, by the way are you also using android studio in converting the game to mobile?
EDIT: IT WORKS! woaaa this is game changing xD IS THERE A WAY TO THE THE SAME WAY FOR THE WIDTH?
i'll try to make another plugin but ill change it into width
EDIT: IT WORKS! woaaa this is game changing xD IS THERE A WAY TO THE THE SAME WAY FOR THE WIDTH?
i'll try to make another plugin but ill change it into width
No just a web deployment… in Safari you can see the same margin at the top and bottom.
i see i see, thank youu
i tried the width id didnt work xD is it fixed that there should be a border in width or it can be removed as well?
There's no border with width AFAIK. Can you show me a screenshot of what you mean? I think it's just a matter of aspect ratio. Below is the original code for rmmz_core.js regarding screen width and as you can see, there is no shrinking being applied.
JavaScript:
Graphics._stretchWidth = function() {
if (Utils.isMobileDevice()) {
return document.documentElement.clientWidth;
} else {
return window.innerWidth;
}
};
yeah I just tried the code the you given to me and replaced the height in width xD
here is the thing that I want to remove
Oh, I see. What you're seeing is just a problem with your project's size. It stretches to maximum height or width but will not change the aspect ratio, so unless the aspect ratio matches your phone's screen shape perfectly, you're always left with borders...
To add to this,
Phone screens vary quite a lot. In fact, my phone is closer to a 4:3 than a 16:9 ratio. A lot of phones opt for a taller display, but there are some phones that use the common 16:9.
So basically, you'd need to have a plugin that checks the devices screen size and adjusts accordingly. It's not so simple because it's going to need to know where to place HUD elements, how to deal with pictures (show pictures or parallaxes, any pngs being displayed)
There's also the matter of how the canvas is rendered in RPG Maker, which isn't necessarily a barrier, but might be something that needs to be considered. Just simply "expanding the camera to see more" could cause problems. You'd likely want to adjust the internal renderer to account for possible edge cases with devices that use weird screen ratios (like my own phone).
So if the plugin doesn't already exist, it's something you're gonna have to comission. Black bars are not the end of the world, and in my opinion, it's not worth the cost. Better to put that money into making a better game instead of erasing black bars.
I see I see thank youu
HUGE help thank you for the information!
Original thread: https://forums.rpgmakerweb.com/threads/mobile-game-full-screen.161065/