Oh, Alt+Enter doesn't work even without plugins: press F4 to toggle windowed/full-screen mode. It works OK for me, with or without the plugin.Sorry for the double post, but I've noticed there is no way to get out of the full screen mode with this (if there's, I haven't found how, ALT + ENTER doesn't do it).
Some players like to toggle between screen modes, so is there a way to add this possibility?
Holy crap, your plug in works!!!!!!!!!! (3 other ones didn't seem to work for me.)If anyone's interested, I've written such a plugin before:
![]()
GitHub - Nolonar/RM_Plugins-StartFullscreen: RPG Maker plugin: Launches game in fullscreen
RPG Maker plugin: Launches game in fullscreen. Contribute to Nolonar/RM_Plugins-StartFullscreen development by creating an account on GitHub.github.com
In addition to launching the game in fullscreen, it also adds an "Exit" to the Title Screen, and a "To Desktop" to the "Game End" menu option.
PS: The plugin is under a MIT license, so you're free to use it in whatever project you like (commercial or free) in whatever way you like.
const Scene_Boot_start = Scene_Boot.prototype.start;
Scene_Boot.prototype.start = function () {
Scene_Boot_start.call(this);
Graphics._requestFullScreen();
};
The above plugin used to work in MV, but broke in MZ.Holy crap, your plug in works!!!!!!!!!! (3 other ones didn't seem to work for me.)
Can you tell me what you are doing that is different from the plug in listed higher up?
Sorry I don't really know js but what is happening here before the call to make the app full screen?
const Scene_Boot_start = Scene_Boot.prototype.start; Scene_Boot.prototype.start = function () { Scene_Boot_start.call(this); Graphics._requestFullScreen(); };
Is "Scene_Boot" something that is built into the engine's base code?
Scene_Boot
is the entry point of your game. It's the first scene that runs when you launch your game. Its purpose is to load the database, fonts, icons, and so on. Once it's finished, it switches to Scene_Title
, which handles the title screen (where players can start a new game or load a save game).Scene_Boot
also resizes the window for some reason. It's this resize process that cancels the fullscreen and breaks the original plugin.Scene_Boot.start()
, when Scene_Boot
has finished resizing the window. This is also compatible to MV, so the plugin works on both engines.const Scene_Boot_start = Scene_Boot.prototype.start;
Scene_Boot.start
function into a variable called Scene_Boot_start
. We do this, because we are going to overwrite that function with our own function, but we still want to execute the original function. This is known as "overriding" or "extending" a function.Scene_Boot.prototype.start = function () { /* code here */ }
Scene_Boot.start
function with our own. The function's code is between the curly brackets ({}
) also known as "braces". At this point, the original function is lost and will no longer be executed. Fortunately, we've saved it to some other variable beforehand, so it's not completely lost.Scene_Boot_start.call(this);
Scene_Boot_start
function, so our new function can reproduce the original function's behavior. The call(this)
part is a bit more complicated to explain, and is easier to understand once you know about object oriented programming.Scene_Boot
is a "class", a template for objects (though in this case, we only need 1 Scene_Boot
object). It contains all variables and functions that a Scene_Boot
object would need. When a function belonging to Scene_Boot
is trying to use another function belonging to Scene_Boot
, it needs to access it using the this
keyword, which represents the current Scene_Boot
object, since there could be more than one (although in this case there aren't).this
keyword can represent a different object, depending on which object the currently running function belongs to. This is known as a "context". For example, if you have a class Player
, then you can use it to create 2 Player
objects, such as player1
and player2
. While Player.die
describes the behavior of the die()
function for a Player
, you don't want player1.die()
to also affect player2
, so the this
object in player1.die()
refers to player1
, and in player2.die()
it would refer to player2
instead.call(context)
function, which ensures that the function (in this case the Scene_Boot.start
function) will use the context
object as its this
object. In this case, our context
object also happens to be our current this
object. In other words, we're forcing the context of Scene_Boot_start
to be the same as our current context (the context of Scene_Boot.start
). The reason this is necessary, is because Scene_Boot_start
doesn't belong to the Scene_Boot
object, even though the function we saved to it does. Instead, it belongs to the Window
object, also known as the "global scope". If you think this is confusing, that's because it is confusing. I honestly don't know a single other programming language that does this. (Note: it is currently 1AM over here, and I'm not entirely 100% sure what I'm saying is correct)Graphics._requestFullScreen();
Oh my gosh, please do not apologize! This was such a fun and important read to me. Honestly! I learned a lot and have you to thank for it.The above plugin used to work in MV, but broke in MZ.
Scene_Boot
is the entry point of your game. It's the first scene that runs when you launch your game. Its purpose is to load the database, fonts, icons, and so on. Once it's finished, it switches toScene_Title
, which handles the title screen (where players can start a new game or load a save game).
In RPG Maker MZ,Scene_Boot
also resizes the window for some reason. It's this resize process that cancels the fullscreen and breaks the original plugin.
My fix was to simply have the plugin request fullscreen afterScene_Boot.start()
, whenScene_Boot
has finished resizing the window. This is also compatible to MV, so the plugin works on both engines.
You've correctly identified the code responsible for switching to fullscreen. The first line:
Saves the originalJavaScript:const Scene_Boot_start = Scene_Boot.prototype.start;
Scene_Boot.start
function into a variable calledScene_Boot_start
. We do this, because we are going to overwrite that function with our own function, but we still want to execute the original function. This is known as "overriding" or "extending" a function.
The next line:
Replaces the originalJavaScript:Scene_Boot.prototype.start = function () { /* code here */ }
Scene_Boot.start
function with our own. The function's code is between the curly brackets ({}
) also known as "braces". At this point, the original function is lost and will no longer be executed. Fortunately, we've saved it to some other variable beforehand, so it's not completely lost.
The first line of our new function:
Is what calls the originalJavaScript:Scene_Boot_start.call(this);
Scene_Boot_start
function, so our new function can reproduce the original function's behavior. Thecall(this)
part is a bit more complicated to explain, and is easier to understand once you know about object oriented programming.
Basically,Scene_Boot
is a "class", a template for objects (though in this case, we only need 1Scene_Boot
object). It contains all variables and functions that aScene_Boot
object would need. When a function belonging toScene_Boot
is trying to use another function belonging toScene_Boot
, it needs to access it using thethis
keyword, which represents the currentScene_Boot
object, since there could be more than one (although in this case there aren't).
Thethis
keyword can represent a different object, depending on which object the currently running function belongs to. This is known as a "context". For example, if you have a classPlayer
, then you can use it to create 2Player
objects, such asplayer1
andplayer2
. WhilePlayer.die
describes the behavior of thedie()
function for aPlayer
, you don't wantplayer1.die()
to also affectplayer2
, so thethis
object inplayer1.die()
refers toplayer1
, and inplayer2.die()
it would refer toplayer2
instead.
Unfortunately, JavaScript can be very confusing when it comes to context. This is why we use thecall(context)
function, which ensures that the function (in this case theScene_Boot.start
function) will use thecontext
object as itsthis
object. In this case, ourcontext
object also happens to be our currentthis
object. In other words, we're forcing the context ofScene_Boot_start
to be the same as our current context (the context ofScene_Boot.start
). The reason this is necessary, is becauseScene_Boot_start
doesn't belong to theScene_Boot
object, even though the function we saved to it does. Instead, it belongs to theWindow
object, also known as the "global scope". If you think this is confusing, that's because it is confusing. I honestly don't know a single other programming language that does this. (Note: it is currently 1AM over here, and I'm not entirely 100% sure what I'm saying is correct)
And finally, the main part of our new function:
Is what performs the actual switch to fullscreen.JavaScript:Graphics._requestFullScreen();
I'm really sorry I wrote this huge wall of text (I tend to write way too much, I admit), and hope that it was at least somewhat helpful for you to understand what the plugin does and what is happening.