Show Picture to fit the screen

Status
Not open for further replies.

Arise

Veteran
Veteran
Joined
Aug 31, 2016
Messages
132
Reaction score
19
Primarily Uses
A "simple" question?!?

I have some high resolution images that I would like to show on screen, but the usual Show Picture command is not resizing the image to fit on screen. I don't want stretching, I'm fine with back bars, I only want some 1920x1080 (full hd) picture for example to be displayed scaled/fit on the RPG Maker MV window.

How do I accomplish that?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,675
First Language
German
Primarily Uses
RMMV
Best way would be to use an image program like gimp or Photoshop to resize it to your game's screen size and then use that.

As you discovered, there is no automatic resize in RMs (or most 2d programs). Theoretically it might be possible to have a plugin do that, but that would be a bad way only to be used if nothing else works. That is because there are different mathematical formulae to do the resize, and the formulae that can be programmed in a simple way usually result in a quality loss and fragmentation.
Dedicated image programs usually have much better formulae for resizing (often giving a choice on which to use) and that will always result in a better quality as well as less wasted space in the project.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Show Picture has a Zoom setting so you could enlarge/reduce it.
 

Arise

Veteran
Veteran
Joined
Aug 31, 2016
Messages
132
Reaction score
19
Primarily Uses
I sort of agree, but for the sake of it, lets say the images I have are 1920x1080, which is way bigger than the default RPG Maker MV resolution.
Also I would like to provide several custom resolutions, up to 1920x1080, I would like the game to resize the Intro/Scenes-Story/Final-GameOver mesaages based on the chosen resolution.

I dont know how the Show Picture works behind the scene, but I was under the impression that rescaling is done automaticaly because the game is using Chrome browser, so I should not worry of any down-scale algorithm for producing bad visual results.

About the scale parameter in Show Picture command, yes it could work, but only if I know the screen width/height before hand, and this would be something to do every time, for every picture.

Basically, I would need a special parameter in the Show Picture interface, like “Fit Image to Screen” that will do exactly that (eventually centered) and ignore the rest of parameters like zoom and X and Y.
 

Super-User

Villager
Member
Joined
Apr 11, 2019
Messages
21
Reaction score
5
First Language
Chinese
Primarily Uses
RMVX
I need the same thing

For part of a solution, one line of JavaScript to retrieval the height of game screen is:
parseInt(document.getElementById("GameCanvas").getAttribute("height")) // replace"height" with "width" for counter part
And for the image size:
ImageManager.loadPicture($gameScreen._pictures[1].name()).height // replace"height" with "width" for counter part
For the missing piece of puzzle:
$gameScreen.showPicture()
This function is not well documented yet. I tried to call it, but results not showing any image. Provided correct way to call this function, I can calculate the correct scale and position for each. (I am a programmer.)

Alright, I tried to call $gameScreen.showPicture() with the same parameters, and failed with following messages:

rpg_managers.js:1949 TypeError: Cannot read property 'length' of undefined
at WebGLState.setBlendMode (pixi.js:18126)
at PictureRenderer._renderNormal (pixi-picture.js:185)
at PictureRenderer.render (pixi-picture.js:179)
at Sprite_Picture.Sprite._renderWebGL (rpg_core.js:4401)
at Sprite_Picture.renderWebGL (pixi.js:9346)
at Sprite.renderWebGL (pixi.js:9350)
at Spriteset_Map.renderWebGL (pixi.js:9350)
at Scene_Map.renderWebGL (pixi.js:9350)
at WebGLRenderer.render (pixi.js:17526)
at Function.Graphics.render (rpg_core.js:1875)

It seems this is a bug of pixi.js . I have opened an issue here: https://github.com/pixijs/pixi.js/issues/5573
 
Last edited by a moderator:

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
@Super-User Please do not double post - that is, post straight after yourself in less than 72 hours. I have merged your 4 posts together.

I think it would be better to discuss this in Javascript/Plugin Support, as I think the coding discussion would go way beyond this section of the forum, and you're more likely to attract the attention of coders if you post there.

[mod]Closing this[/mod]
 
Status
Not open for further replies.

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

Latest Threads

Latest Profile Posts

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD

Forum statistics

Threads
105,868
Messages
1,017,070
Members
137,577
Latest member
SadaSoda
Top