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

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:
Spoiler
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 🙂
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.
If you resize the window after init, you need to recreate the contents bitmap to match the new window size, i.e. this.createContents();.
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.
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. 🙂
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.) 😴

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

Unrelated, but I did notice this in your save plugin:
Spoiler: bitmap destroy stuff
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;
};
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 🙂

Original thread: https://forums.rpgmakerweb.com/threads/creating-a-save-screen-plugin-minor-graphic-issue-please-help.148892/