Mikagami Alter Thumbnail Save Screen Refference
https://raw.githubusercontent.com/ovate/MikagamiAtelier-rgss3/main/MA_SaveThumbnail.rb
Okay so the script turns the screenshot's bitmap into an array and saves the array. It makes heavier savefiles than with Zeus's script though.
These are the script I try to learn of. What I don't understand is how to re-arrange the windows and thumbnail saving. I want to know more about it.
By rearanging, what do you want exactly?
If you want to change the size and the position of the windows, check the Window_ classes in yanfly's script.
Window_FileList is the list of all files name
Window_FileStatus is the preview of your file
Window_FileAction is the list of actions to deal with a save (save/load/delete)
You can change their position and size in method intiialize for each window class:
Ruby:
class Window_FileList < Window_Selectable
def initialize(dx, dy)
#super(x,y,width,height)
#where x,y are the position of the window
#width,height are its size
super(dx, dy, 128, Graphics.height - dy)
#...
end
end
If you want to change what is displayed in the preview, you have to check
Window_FileStatus and more precisely its method
draw_save_contents as you have already guessed.
Then you can add new methods or modify all sub methods that draw something to change how it looks.
To display the picture, you can take a screenshot with
Graphics.snap_to_bitmap and save the result into a bitmap object that you will access later.
Then, if you can access it, you can write something like this:
(here is a simplier code from my own addon to Yanfly's script)
Ruby:
#dx,dy the position of the picture, dw the width of the window
def draw_map_picture(dx, dy, dw)
bitmap = get_screenshot_bitmap #my own way of getting the screenshot
return unless bitmap #to avoid eventual crashes if the bitmap does not exists
h = NeoSave::SCREENSHOT_HEIGHT #a constant to define yourself, you can put a number
#take a rectangle inside the screenshot picture with the first two values being the upper-left corner (it's like you cut the picture to pick what matters)
#dw the width of the rectangle and h its height
rect = Rect.new(0,0, dw, h)
#now draw anything inside the bitmap that is inside the rectangle and put it in position dx,dy
#255 here is the opacity, put a lower value if you want some transparency
contents.blt(dx, dy, bitmap, rect, 255)
bitmap.dispose #get rid of the bitmap to avoid memory issue if get_screenshot_bitmap gives a new one
end
Saving the bitmap is the tricky part as it can't be done without writing your own way to save it, that's why I recommend you use another script like Zeus's to export the bitmap, otherwise you can write your own way to convert the bitmap into something that can be exported like
Mikagami Alter Thumbnail Save Screen where methods
bitmap_to_array and
array_to_bitmapwere written for instance.
Then if you have a way to export the bitmap, you should modify method
make_save_header to store the bitmap inside the hash table.
Everything I describe is basically performed one way or another in my published script or its required scripts so you can check them if you want to see how it has been done.