Bodkaa ScreenFit

Jecht

Veteran
Veteran
Joined
Jul 15, 2015
Messages
44
Reaction score
24
First Language
Italian
Primarily Uses
This script allow the game to fit the screen to the resolution set on the pc.

*Still need to adjust battlemember and enemy position Should work now! Does not support 800x600 or inferior

**You need a folder for every resolution possible called like the resolution itself(1920x1080, 1024x768, etc)

//=============================================================================// ScreenFit.js// Version: 1.5//============================================================================= /*: * @plugindesc v 1.5 Fit width and height to the resolution of your screen. Select what folder of battleback have to use. Can force full screen. Can select screen width an height * @author Bodkaa *@param Fullscreen *@desc 1 = force fullscreen 0 = no force *@default 1 * @param width * @desc set width * @default 816 * @param height * @desc set height * @default 618 * @param Screen resolution set * @desc Possible value: Enabled , Disabled. If enabled use width and height param for screen size, else use the monitor resolution. * @default Disabled*/var parameters = PluginManager.parameters('ScreenFit');var FullScreen = Number(parameters['Fullscreen']);var lineHeight = Window_Base.prototype.lineHeight();var actualWidth = Number (parameters['width']);var actualHeight = Number(parameters['height']);var selectResType = String(parameters['Screen resolution set']);if(selectResType == 'Disabled'){SceneManager._screenWidth = screen.width;SceneManager._screenHeight = screen.height;SceneManager._boxWidth = screen.width;SceneManager._boxHeight = screen.height;}else if (selectResType == 'Enabled'){SceneManager._screenWidth = actualWidth;SceneManager._screenHeight = actualHeight;SceneManager._boxWidth = actualWidth;SceneManager._boxHeight = actualHeight;}SceneManager_run = SceneManager.run;SceneManager.run = function(sceneClass) { SceneManager_run.call(this, sceneClass); if (FullScreen == 1){Graphics._switchFullScreen()};};Scene_Battle.prototype.createActorWindow = function() { this._actorWindow = new Window_BattleActor(0, this._statusWindow.y); this._actorWindow.setHandler('ok', this.onActorOk.bind(this)); this._actorWindow.setHandler('cancel', this.onActorCancel.bind(this)); this.addWindow(this._actorWindow);};Scene_Battle.prototype.createEnemyWindow = function() { this._enemyWindow = new Window_BattleEnemy(0, this._statusWindow.y); this._enemyWindow.x = Graphics.boxWidth - this._enemyWindow.width; this._enemyWindow.setHandler('ok', this.onEnemyOk.bind(this)); this._enemyWindow.setHandler('cancel', this.onEnemyCancel.bind(this)); this.addWindow(this._enemyWindow);};//********************** Change resolution path **********************//ImageManager.loadBattleback1 = function(filename, hue) { return this.loadBitmap('img/resolution/'+ Graphics.boxWidth + "x" + Graphics.boxHeight + '/battlebacks1/', filename, hue, true);}ImageManager.loadBattleback2 = function(filename, hue) { return this.loadBitmap('img/resolution/'+ Graphics.boxWidth + "x" + Graphics.boxHeight + '/battlebacks2/', filename, hue, true);}//********************** Sprite_Actor **********************//Sprite_Actor.prototype.setActorHome = function(index) { this.setHome(Graphics.boxWidth - (Graphics.boxWidth * 0.2) + index * 40 , Graphics.boxHeight / 2 + index * (Graphics.boxHeight / 12.5));};//********************** Sprite_Enemy **********************//Sprite_Enemy.prototype.setBattler = function(battler) { Sprite_Battler.prototype.setBattler.call(this, battler); this._enemy = battler; this.setHome(Graphics.boxWidth -(Graphics.boxWidth) + battler.screenX() , battler.screenY() + (Graphics.boxHeight - lineHeight * 18 )); this._stateIconSprite.setup(battler);};//********************** GameOver Bitmap *******************//Scene_Gameover.prototype.createBackground = function() { this._backSprite = new Sprite(); this._backSprite.bitmap = ImageManager.loadBitmap('img/resolution/'+ Graphics.boxWidth + "x" + Graphics.boxHeight + '/system/','GameOver'); this.addChild(this._backSprite);}; V 1.5

You can now decide if you want use the monitor resolution or set it as your wish.

V 1.4 

Modifed the path to img/resolution/resolutionInNumber/battelback 

V 1.3

Added the path for the GameOver image in img/*resolution*/system/  (Thanks to Serpent for the bug report)

V 1.2 

Improved Actor and Battler position

For resize the image you can use this! https://imageresizer.codeplex.com/
 
Last edited by a moderator:

Prescott

argggghhh
Veteran
Joined
Aug 28, 2014
Messages
491
Reaction score
390
First Language
English
Primarily Uses
RMMV
Aha, this is pretty dang cool! Put this under or above the YEP CoreEngine? OR does it not work with it at all?
 

Serpent

Villager
Member
Joined
Oct 26, 2015
Messages
5
Reaction score
3
First Language
English
I didn't get any game crashing errors running a quick test with it under the CoreEngine, although I did accidentally discover that the game over screen is off center for some reason. Putting it above the CoreEngine has no effect. It seems it gets overwritten.

Otherwise pretty neat. I like this one.
 
Last edited by a moderator:

Jecht

Veteran
Veteran
Joined
Jul 15, 2015
Messages
44
Reaction score
24
First Language
Italian
Primarily Uses
Aha, this is pretty dang cool! Put this under or above the YEP CoreEngine? OR does it not work with it at all?
I will test it asap but for now put it after and test if works

Edit:

I tryed and if u place it after it will work! i saw he made something about resizing the image so maybe looking onto it i will be able to just use only the 1 image for all resolution

I didn't get any game crashing errors running a quick test with it under the CoreEngine, although I did accidentally discover that the game over screen is off center for some reason. Putting it above the CoreEngine has no effect. It seems it gets overwritten.

Otherwise pretty neat. I like this one.
Ty for the info! ill look on it asap



Edit: Done! you have to create a "system" folder into every resolution folder and add the GameOver.png stretched to that resolution. I will upload these folder with all image stretched too (if my connection will allow me to do that  ;_;  )

Code:
//********************** GameOver Bitmap *******************//Scene_Gameover.prototype.createBackground = function() {    this._backSprite = new Sprite();	this._backSprite.bitmap = ImageManager.loadBitmap('img/'+ Graphics.boxWidth + "x" + Graphics.boxHeight + '/system/','GameOver');    this.addChild(this._backSprite);};
 
Last edited by a moderator:

Hiek

Creator
Veteran
Joined
Jul 14, 2012
Messages
231
Reaction score
57
First Language
English
Honestly, I don't like how this was done compared to VX Ace.

So, we need to make a folder for 'every' resolution, which requires pasting for each resolution and re-sizing

when we add more content?

Not to mention, this will take up way too much space for building a long game.

 

I don't want to sound picky, but could you see if you could re-create this Fullscreen++ Script for JavaScript if possible?
http://forums.rpgmakerweb.com/index.php?/topic/14081-fullscreen/
 
 

Jecht

Veteran
Veteran
Joined
Jul 15, 2015
Messages
44
Reaction score
24
First Language
Italian
Primarily Uses
Ty for the post and the info! As my skill with that new system is pretty low i m always looking on new info and always trying to improve miself, i will look at this post tomorrow when i will be at home. For now i can say that i did the script in this way becouse i cant figure out how i can resize the battleback for every resolution. I dont like the need of all folder and the size of the project too. Ty again for the usefull post
 

Hiek

Creator
Veteran
Joined
Jul 14, 2012
Messages
231
Reaction score
57
First Language
English
Ty for the post and the info! As my skill with that new system is pretty low i m always looking on new info and always trying to improve miself, i will look at this post tomorrow when i will be at home. For now i can say that i did the script in this way becouse i cant figure out how i can resize the battleback for every resolution. I dont like the need of all folder and the size of the project too. Ty again for the usefull post
You don't really have to worry about the Battlebacks.

Yanfly did this already in an update for his Core Engine.

But the Full Screen Stretch I'm looking for is to get rid of the black boarders by stretching

the current resolution we have set for the game.

(Not our actual monitor resolution.)
 

Jecht

Veteran
Veteran
Joined
Jul 15, 2015
Messages
44
Reaction score
24
First Language
Italian
Primarily Uses
 

You don't really have to worry about the Battlebacks.
Yanfly did this already in an update for his Core Engine.

But the Full Screen Stretch I'm looking for is to get rid of the black boarders by stretching
the current resolution we have set for the game.
(Not our actual monitor resolution.)

 
Updated the script on the first post, try it and please post some feedback. Ty!
 
Last edited by a moderator:

tale

Volunteer
Veteran
Joined
Dec 16, 2016
Messages
631
Reaction score
1,065
First Language
English
Primarily Uses
N/A
Fixed format, also included in file attachment. *credit Bodkaa

**You need a folder for every resolution possible called like the resolution itself(1920x1080, 1024x768, etc)

Note: Does not support 800x600 or inferior

Code:
//=============================================================================
// ScreenFit.js
// Version: 1.5
//=============================================================================
/*:
 * @plugindesc v 1.5 Fit width and height to the resolution of your screen.
 * Select what folder of battleback have to use. Can force full screen.
 * Can select screen width an height
 * @author Bodkaa
 * @param Fullscreen
 * @desc 1 = force fullscreen 0 = no force
 * @default 1
 * @param width
 * @desc set width
 * @default 816
 * @param height
 * @desc set height
 * @default 618
 * @param Screen resolution set
 * @desc Possible value: Enabled , Disabled. If enabled use width and height param for screen size, else use the monitor resolution.
 * @default Disabled
  */
var parameters = PluginManager.parameters('ScreenFit');
var FullScreen = Number(parameters['Fullscreen']);
var lineHeight = Window_Base.prototype.lineHeight();
var actualWidth = Number(parameters['width']);
var actualHeight = Number(parameters['height']);
var selectResType = String(parameters['Screen resolution set']);
if (selectResType == 'Disabled') {
    SceneManager._screenWidth = screen.width;
    SceneManager._screenHeight = screen.height;
    SceneManager._boxWidth = screen.width;
    SceneManager._boxHeight = screen.height;
} else if (selectResType == 'Enabled') {
    SceneManager._screenWidth = actualWidth;
    SceneManager._screenHeight = actualHeight;
    SceneManager._boxWidth = actualWidth;
    SceneManager._boxHeight = actualHeight;
}
SceneManager_run = SceneManager.run;
SceneManager.run = function(sceneClass) {
    SceneManager_run.call(this, sceneClass);
    if (FullScreen == 1) {
        Graphics._switchFullScreen()
    };
};
Scene_Battle.prototype.createActorWindow = function() {
    this._actorWindow = new Window_BattleActor(0, this._statusWindow.y);
    this._actorWindow.setHandler('ok', this.onActorOk.bind(this));
    this._actorWindow.setHandler('cancel', this.onActorCancel.bind(this));
    this.addWindow(this._actorWindow);
};
Scene_Battle.prototype.createEnemyWindow = function() {
    this._enemyWindow = new Window_BattleEnemy(0, this._statusWindow.y);
    this._enemyWindow.x = Graphics.boxWidth - this._enemyWindow.width;
    this._enemyWindow.setHandler('ok', this.onEnemyOk.bind(this));
    this._enemyWindow.setHandler('cancel', this.onEnemyCancel.bind(this));
    this.addWindow(this._enemyWindow);
};
//********************** Change resolution path **********************
//
ImageManager.loadBattleback1 = function(filename, hue) {
    return this.loadBitmap('img/resolution/' + Graphics.boxWidth + "x" + Graphics.boxHeight + '/battlebacks1/', filename, hue, true);
}
ImageManager.loadBattleback2 = function(filename, hue) {
    return this.loadBitmap('img/resolution/' + Graphics.boxWidth + "x" + Graphics.boxHeight + '/battlebacks2/', filename, hue, true);
}
//********************** Sprite_Actor **********************
//
Sprite_Actor.prototype.setActorHome = function(index) {
    this.setHome(Graphics.boxWidth - (Graphics.boxWidth * 0.2) + index * 40, Graphics.boxHeight / 2 + index * (Graphics.boxHeight / 12.5));
};
//********************** Sprite_Enemy **********************
//
Sprite_Enemy.prototype.setBattler = function(battler) {
    Sprite_Battler.prototype.setBattler.call(this, battler);
    this._enemy = battler;
    this.setHome(Graphics.boxWidth - (Graphics.boxWidth) + battler.screenX(), battler.screenY() + (Graphics.boxHeight - lineHeight * 18));
    this._stateIconSprite.setup(battler);
};
//********************** GameOver Bitmap *******************
//
Scene_Gameover.prototype.createBackground = function() {
    this._backSprite = new Sprite();
    this._backSprite.bitmap = ImageManager.loadBitmap('img/resolution/' + Graphics.boxWidth + "x" + Graphics.boxHeight + '/system/', 'GameOver');
    this.addChild(this._backSprite);
};

Edit: For resize the image you can use this! http://www.bricelam.net/ImageResizer/

dropbox link: https://www.dropbox.com/s/3kkpj08z7jadv9f/ScreenFit.js?dl=1
 

Attachments

Last edited:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

JDgoldvox wrote on Mr. Detective's profile.
hey, could u help me with a problem? basically, How do I delete a character from a map after a cut scene is over? I am really new with RPG maker MV. Please help!
The most rewarding part of making custom body character parts is absolutely not making the masks work. Somebody please put me out of my misery.
Any commercial devs here ever mess with Gamejolt? Been contemplating making my games available there but don't know if it's worth the effort or not.
Social distancing taught me of how much of not a loner I am. Dammit, I miss seeing my friends...
Happy 4th of July all. Anybody have plans? Mine here is staying home away from the virus. Still a nice 3 day weekend.

Forum statistics

Threads
99,262
Messages
963,606
Members
130,856
Latest member
superfluffy
Top