RMMZ Creating a save screen plugin - minor graphic issue, please help

ct_bolt

Creator
Veteran
Joined
May 3, 2012
Messages
1,179
Reaction score
732
First Language
Javascript
Primarily Uses
RMMZ
Ok so I'm creating a save screen plugin but cannot for the life of me figure out why this is happening...

Screenshot of the issue:
1656212320495.png

Video Demo of the issue:
When going backwards in selecting files the last file image/text gets cut off because it isn't redrawing properly I guess?
...but I've tried many approaches and just can't figure it out.
I'm going crazy trying to solve this one :blink::dizzy:

...so now I look to the forums for help...

Here is a small demo project if anyone can please help me solve this issue.
Save Screen Issue - CTB: Click Here to Download

Thank you in advance for your time and help with this :)
 
Last edited:

ShadowDragon

Realist
Veteran
Joined
Oct 8, 2018
Messages
6,004
Reaction score
2,347
First Language
Dutch
Primarily Uses
RMMV
you can try with one of the following if that works:

1) resize save screen to fit 3 (on resolution width) and see if that works.
2) if backwards do works, than something is missing.

I can give it a try as a beginner, but I might learn something as I already
use a nice save screen plugin :). horizontal selection is unique though.
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
3,807
Reaction score
2,867
First Language
EN
Primarily Uses
RMMZ
If you resize the window after init, you need to recreate the contents bitmap to match the new window size, i.e. this.createContents();.
 

ShadowDragon

Realist
Veteran
Joined
Oct 8, 2018
Messages
6,004
Reaction score
2,347
First Language
Dutch
Primarily Uses
RMMV
I also see no "update" in window_saveFile with the plugin I use
in MV which check if !busy to open the listwindow.

MZ works probably differently with those.
 

ct_bolt

Creator
Veteran
Joined
May 3, 2012
Messages
1,179
Reaction score
732
First Language
Javascript
Primarily Uses
RMMZ
If you resize the window after init, you need to recreate the contents bitmap to match the new window size, i.e. this.createContents();.
Sorry, gosh I'm feeling so dumb right now but I don't really get what to do with this information.

Thanks again for the help by the way though. I really really do appreciate it. :)
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
3,807
Reaction score
2,867
First Language
EN
Primarily Uses
RMMZ
Ah, sorry, now I've looked at your code I see you don't resize the window after init, so what I said doesn't apply. (Also, if it was a contents size problem then a fixed amount would remain cut off at all times, which isn't what happens in your video/demo.) :kaoslp:

I guess it's related to one of these:
  • 2.5 visible columns, like @ShadowDragon mentioned - for example, it paints flawlessly when your numVisibleCols method returns 2. The core scripts have no trouble painting partial rows, so you may want to double check your horizontal scrolling plugin?

  • Your load listener approach in drawItem - for instance, the local rect var will not necessarily be the same if scroll has changed since the paint request. That said, I tried SceneManager._scene._listWindow.redrawCurrentItem() via the console once stationary and it seemed to change nothing, so I dunno. :kaoswt:

Unrelated, but I did notice this in your save plugin:
JavaScript:
$_$._measureTextWidth = function (text) {
   var bmp = new Bitmap();
   var width = Math.ceil(bmp.measureTextWidth(text));
   bmp = null;
   return width;
};
To properly free the base texture of the bitmap for garbage collection you should use Bitmap#destroy (rmmz_core.js) instead of simply setting the Bitmap wrapper to null, i.e.
JavaScript:
$_$._measureTextWidth = function (text) {
   var bmp = new Bitmap();
   var width = Math.ceil(bmp.measureTextWidth(text));
   bmp.destroy();
   return width;
};
 

ct_bolt

Creator
Veteran
Joined
May 3, 2012
Messages
1,179
Reaction score
732
First Language
Javascript
Primarily Uses
RMMZ
Okay so I ended up just settling for 3 instead of the 2.5 columns...

But now I have another totally separate issue...

I noticed that my method of how the screenshot images were loaded caused a small delay/flicker when moving through the list... so then I thought okay I'll just load them all when the scene is created...
well that basically worked but now there is still a small few second delay before they are shown...

can anyone pretty please help me fix this issue?

Here's a link to the latest project:
Save Screen Issue - CTB: Click Here to Download

Thank you again in advance for your time and help with this :)
 

Latest Threads

Latest Posts

Latest Profile Posts

Coin Locker title screen:
Still in progress...

Screenshot_134.png
the girls.png
So, these are all the girls of the party =3 (beside the protagonist if you play as a female.)
Now, I just have one more character sheet of the guys left and I'm done with their presentations =3
Can you recognize where this area is from? :kaocry:
Mq9QM3h.png
For those with up to 9 elements of magic; how do you structure your database. By element? Or by what is offensive vs supportive spells?
would anyone here be interested in rough concept art for the main protagonist of my game that might get changed later? :kaoswt2:

Forum statistics

Threads
124,442
Messages
1,163,680
Members
163,256
Latest member
onbetltd
Top