Indinera

Indie Dev
Veteran
Joined
Mar 13, 2012
Messages
2,265
Reaction score
1,034
First Language
French
Is there a small plugin that allows to launch the game in full screen directly?
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
3,523
Reaction score
2,650
First Language
EN
Primarily Uses
RMMZ
Yup, stick this in a .js file (Save As > File Type: All Files, Filename: whatever.js) and import as a plugin~
JavaScript:
Graphics._requestFullScreen();
 

Indinera

Indie Dev
Veteran
Joined
Mar 13, 2012
Messages
2,265
Reaction score
1,034
First Language
French
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?
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
3,523
Reaction score
2,650
First Language
EN
Primarily Uses
RMMZ
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?
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. :kaopride:

(If F4 doesn't work for you, you may need to manually update your project files to the same version as your editor. For instructions, see the relevant thread in the RPG Maker Software Updates subforum.)

Once in full-screen, you can also toggle stretched/bordered view by pressing F3~ :kaophew:
 

jjraymonds

Veteran
Veteran
Joined
Feb 1, 2020
Messages
65
Reaction score
8
First Language
English
Primarily Uses
RMMV
I tried using this plug in, but when the game launches it starts in full screen then immediately reverts back to windowed mode, is there a project setting or something I could be missing? :blush:

I tried the plug in on a blank project, and a 3 different computers so I can't be conflicting with other plug ins or some computer setting right?

When looking at the Debug log for nw.js this shows up?

"[1208/164845.730:ERROR:settings.cc(325)] Settings version is not 1"
 
Last edited:

Nolonar

Veteran
Veteran
Joined
Feb 18, 2018
Messages
389
Reaction score
544
First Language
French, German
Primarily Uses
RMMZ
If anyone's interested, I've written such a plugin before:

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.
 
Last edited:

jjraymonds

Veteran
Veteran
Joined
Feb 1, 2020
Messages
65
Reaction score
8
First Language
English
Primarily Uses
RMMV
If anyone's interested, I've written such a plugin before:

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.
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?
 

Nolonar

Veteran
Veteran
Joined
Feb 18, 2018
Messages
389
Reaction score
544
First Language
French, German
Primarily Uses
RMMZ
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?
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 to Scene_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 after Scene_Boot.start(), when Scene_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:
JavaScript:
const Scene_Boot_start = Scene_Boot.prototype.start;
Saves the original 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.

The next line:
JavaScript:
Scene_Boot.prototype.start = function () { /* code here */ }
Replaces the original 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:
JavaScript:
Scene_Boot_start.call(this);
Is what calls the original 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.

Basically, 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).

The 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.

Unfortunately, JavaScript can be very confusing when it comes to context. This is why we use the 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)

And finally, the main part of our new function:
JavaScript:
Graphics._requestFullScreen();
Is what performs the actual switch to fullscreen.


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.
 
Last edited:

jjraymonds

Veteran
Veteran
Joined
Feb 1, 2020
Messages
65
Reaction score
8
First Language
English
Primarily Uses
RMMV
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 to Scene_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 after Scene_Boot.start(), when Scene_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:
JavaScript:
const Scene_Boot_start = Scene_Boot.prototype.start;
Saves the original 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.

The next line:
JavaScript:
Scene_Boot.prototype.start = function () { /* code here */ }
Replaces the original 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:
JavaScript:
Scene_Boot_start.call(this);
Is what calls the original 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.

Basically, 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).

The 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.

Unfortunately, JavaScript can be very confusing when it comes to context. This is why we use the 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)

And finally, the main part of our new function:
JavaScript:
Graphics._requestFullScreen();
Is what performs the actual switch to fullscreen.


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.
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.
 

Latest Threads

Latest Posts

Latest Profile Posts

Finally finished my tiefling!
F222514F-9F32-4B97-88C3-664E8A2134C3.gif
I wonder... If I develop my own game hacks, does it count as beating the game my own way?
First 12 minutes of gameplay.

bio-Synthetica's Database plugin is complete. Players will be able to find and unlock various tutorials and lore as they reach certain points. There are 5 categories of files you can unlock: Audio Clips, Data Files, Bestiary, Earth History, and Tutorials.

1653160049600.png

Thank you Dsiver for this amazing plugin! :kaothx:

Forum statistics

Threads
122,013
Messages
1,145,899
Members
160,285
Latest member
RunicWings
Top