I was looking for some plugin or option that could help me adjusting the size of any picture to the same size of my game screen. But I could not find anything.
So I made it myself. I hope this can help someone. If you have any corrections to my code please comment. Thank you
So I made it myself. I hope this can help someone. If you have any corrections to my code please comment. Thank you
//=============================================================================
// RPG Maker MZ - Button Picture
//=============================================================================
/*:
* @target MZ
* @plugindesc Adjust pictures size in full screen.
* @author geskechan
*
* @help FullScreenPicture.js
*
*/
(() => {
const _Game_Picture_show = Game_Picture.prototype.show;
Game_Picture.prototype.show = function() {
_Game_Picture_show.apply(this, arguments);
let bitmap = ImageManager.loadPicture(this._name);
let image = bitmap._image;
let adjustedScaleX = (Graphics.width / image.naturalWidth) * 100;
let adjustedScaleY = (Graphics.height / image.naturalHeight) * 100;
this._scaleX = adjustedScaleX;
this._scaleY = adjustedScaleY;
};
const _Game_Picture_move = Game_Picture.prototype.move;
Game_Picture.prototype.move = function() {
_Game_Picture_move.apply(this, arguments);
let bitmap = ImageManager.loadPicture(this._name);
let image = bitmap._image;
let adjustedScaleX = (Graphics.width / image.naturalWidth) * 100;
let adjustedScaleY = (Graphics.height / image.naturalHeight) * 100;
this._targetScaleX = adjustedScaleX;
this._targetScaleY = adjustedScaleY;
};
})();