Improve load time

Hi, Im wondering how you can improve loading times.

On some machines my Custom Menu needs long to load. I think because it is so image heavy.

Maybe someone can give me a Tip where I could improve some of the code or maybe there are some other ways to display images:

Here is my Script:

Spoiler
#==============================================================================# ▼ Tales of Vesperia CMS# -- Autor: eugene222# -- Version: 1.1# -- Date Last Updated: 29.09.2013# -- Date Created: 27.09.2013# -- Credits: eugene222, Valentine if you use his "status_bg.png"# # -- Note: Do not use the Icons included in the Demo, make your owns# I don't know who made these, so I cant give Credit. If somebody# know, please PM me.## I don't know who made the Background Picture. I have it from this # site: http://hdnaturepictures.com/anime-nature-wild-jungle.html## -- Thanks to: Reedo, who helped me with fixing some bug##==============================================================================# ▼ Changelog#==============================================================================# Version 1.1 : Fixed some bugs, and added the Option to use Custom Faces# Version 1.0a : Fixed a Bug when you Close the Window with no Layout Graphic# Version 1.0 : Created the Script#==============================================================================# ▼ Instructions#==============================================================================# To install this script, open up your script editor and copy/paste this script# to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.## You need the following files in Graphics/Menu:## Icons:# item.png, skill.png equip.png, status.png formation.png, save.png, game_end.png# custom1-3.png if you use custom scenes and none.png ## Background:# menu_bg.jpg, menu.layout.png, status.png## See in the Demo how big the Pictures have to be.### Use the Config-Section below to Config the Mini-Icons and the Commands.## Only edit the the first three elements( enabled?, Name, Helptext)## For CustomCommands look below.##==============================================================================module Eugene222 module MConfig #--------------------------------------------------------------------------- # *CONFIG START* # # # *Configure Icon Index* #--------------------------------------------------------------------------- LocationIcon = 231 GoldIcon = 361 StepIcon = 467 BattleIcon = 131 TimeIcon = 280 #--------------------------------------------------------------------------- # *Do you want to use Custom Facesets?* # # Set to true if yes and to false if not # The Custom Faceset should be 100x188 # # The Facegraphic should be in the folder /Menu # The name should be: Actorname_face.png # eg.: "Eric_face.png" if the actors name is "Eric" #--------------------------------------------------------------------------- CustomFace = true #--------------------------------------------------------------------------- # *Default Menu Commands* #--------------------------------------------------------------------------- DC = { # Don't touch this line! #--------------------------------------------------------------------------- # Key enabled?, Name, Helptext #--------------------------------------------------------------------------- :item => [ true, "Item", "Choose items", :command_item], :skill => [ true, "Skill", "Choose skills", :command_personal], :equip => [ true, "Equipment", "Change equipment", :command_personal], :status => [ true, "Status", "View your status", :command_personal], :formation => [ true, "Formation", "Change formation", :command_formation], #--------------------------------------------------------------------------- # *Custom Menu Commands* # Key enabled?, Name, Helptext, :Symbol, Scene_Name # # # The Menu can handle 3 Custom Scenes. You have to set the Classname of # the Custom Scene after the Symbol. All custom Scenes have to be on top # of this Script. # # Example: # :custom1 => [ true, "Example", "Exampletext", # :custom_command, Scene_Example], # #--------------------------------------------------------------------------- :custom1 => [ true, "Questlog", "Exampletext", :custom_command, Scene_Item], :custom2 => [ false, "", "", :custom_command, ], :custom3 => [ false, "", "", :custom_command, ], #--------------------------------------------------------------------------- # *Save And Game_END Commands* #--------------------------------------------------------------------------- :save => [ true, "Speichern", "Save your progress", :command_save], :game_end => [ true, "Ende", "End the game", :command_game_end], #--------------------------------------------------------------------------- } # Don't touch this line! # # # *Config* END #--------------------------------------------------------------------------- endend#==============================================================================# ** new Window_Menu# methods: initialize, set_text, create_bg, draw_location, refresh, dispose,# dispose_icons, dispose_bg, dispose_bg1#==============================================================================class Window_Menu < Window_Help #----------------------------------------------------------------------------- include Eugene222::MConfig #----------------------------------------------------------------------------- # * initialize #----------------------------------------------------------------------------- def initialize(*args) super(*args) create_bg end #----------------------------------------------------------------------------- # * set_text #----------------------------------------------------------------------------- def set_text(line1, line2) unless line1 == @line1 @line1 = line1 @line2 = line2 refresh end end #----------------------------------------------------------------------------- # * create_bg #----------------------------------------------------------------------------- def create_bg @bg = Sprite.new @bg.bitmap = Cache.menu("menu_bg") rescue nil @bg1 = Sprite.new @bg1.bitmap = Cache.menu("menu_layout") rescue nil end #----------------------------------------------------------------------------- # * draw_location #----------------------------------------------------------------------------- def draw_location rect = Rect.new(contents.width/2,0, contents.width/2 - 26,line_height) contents.font.color = hp_gauge_color1 draw_text(rect,$game_map.display_name,2) draw_icon(LocationIcon, contents_width - 25, 0) unless $game_map.display_name == "" end #----------------------------------------------------------------------------- # * refresh #----------------------------------------------------------------------------- def refresh contents.clear contents.font.bold = true contents.font.color = system_color rect = Rect.new(0,0,contents.width/2, line_height) draw_text(rect,@line1) draw_location reset_font_settings rect = Rect.new(0,line_height, contents.width, line_height) draw_text(rect,@line2) end #----------------------------------------------------------------------------- # * dispose #----------------------------------------------------------------------------- def dispose super dispose_bg dispose_bg1 dispose_icons end #----------------------------------------------------------------------------- # * dispose_icons #----------------------------------------------------------------------------- def dispose_icons return unless @icon @icon.dispose end #----------------------------------------------------------------------------- # * dispose_bg #----------------------------------------------------------------------------- def dispose_bg return unless @bg @bg.bitmap.dispose if @bg.bitmap @bg.dispose end #----------------------------------------------------------------------------- # * dispose_bg1 #----------------------------------------------------------------------------- def dispose_bg1 return unless @bg1 @bg1.bitmap.dispose if @bg1.bitmap @bg1.dispose end #-----------------------------------------------------------------------------end#==============================================================================# ** Window_MenuCommand# new methods: init_commands, text#==============================================================================class Window_MenuCommand < Window_Command #----------------------------------------------------------------------------- include Eugene222::MConfig #----------------------------------------------------------------------------- # * initialize #----------------------------------------------------------------------------- def initialize(x,y) init_commands super(x,y) self.width = 24 + item_max * (48+spacing) self.height = 72 self.opacity = 0 select_last update end #----------------------------------------------------------------------------- # * Settings #----------------------------------------------------------------------------- def contents_width;(item_width + spacing) * item_max - spacing; end; def contents_height; 0; end; def item_height; 48; end; def col_max; item_max;; end; def spacing; 4; end; #----------------------------------------------------------------------------- # * make_command_list #----------------------------------------------------------------------------- def make_command_list DC.each do |k, v| case k when :save add_command(v[1], k, true,v[4]) if save_enabled when :formation add_command(v[1], k, true, v[4]) if formation_enabled else add_command(v[1], k, true,v[4]) if v[0] end end end #----------------------------------------------------------------------------- # * init_commands #----------------------------------------------------------------------------- def init_commands @commands = [] DC.each do |k,v| case k when :save @commands << k if save_enabled when :formation @commands << k if formation_enabled else @commands << k if v[0] end end end #----------------------------------------------------------------------------- # * draw_all_items #----------------------------------------------------------------------------- def draw_all_items @sprite_items = [] @commands.each_with_index do |command,index| icon = Cache.menu(command.to_s) rescue Cache.menu("none") sprite = Sprite.new sprite.bitmap = icon sprite.x = index * (48 + spacing) + self.x + 12 sprite.y = self.y + 12 sprite.z = self.z + 1 sprite.opacity = 155 @sprite_items << sprite end end #----------------------------------------------------------------------------- # * item_rect #----------------------------------------------------------------------------- def item_rect(index) rect = super rect.x = index * (48 + spacing) rect.y = 0 rect.width = 48 rect.height = 48 rect end #----------------------------------------------------------------------------- # * update #----------------------------------------------------------------------------- def update super unless @index == @s_index @s_index == @index @sprite_items.each {|sprite| sprite.opacity = 155} @sprite_items[@index].opacity = 255 end end #----------------------------------------------------------------------------- # * update_help #----------------------------------------------------------------------------- def update_help; @help_window.set_text(command_name(index),text(index)) end; #----------------------------------------------------------------------------- # * text #----------------------------------------------------------------------------- def text(index); DC[@list[index][:symbol]][2] end; #----------------------------------------------------------------------------- # * dispose #----------------------------------------------------------------------------- def dispose super return unless @sprite_items @sprite_items.each {|sprite| sprite.bitmap.dispose; sprite.dispose} @sprite_items = nil end #-----------------------------------------------------------------------------end#==============================================================================# ** new Window_NewMenuStatus# methods: initialize, [...], top_col=, calc_new_x ensure_cursor_visible, # item_rect, draw_item, draw_actor_simple_status, draw_actor_level, # draw_actor_exp, draw_layout, dispose#==============================================================================class Window_NewMenuStatus < Window_MenuStatus #----------------------------------------------------------------------------- attr_reader 😛ending_index #----------------------------------------------------------------------------- # * initialize #----------------------------------------------------------------------------- def initialize(x, y) @layout = [] @face = [] super(x, y) self.opacity = 0 self.ox = 0 @pending_index = -1 refresh end #----------------------------------------------------------------------------- # * settings #----------------------------------------------------------------------------- def window_width; Graphics.width; end; def window_height; Graphics.height - 72*2.5; end; def contents_width; (item_width + spacing) * item_max - spacing; end; def contents_height; item_height; end; def spacing; 24; end; def visible_line_number; 0; end; def item_height; height - standard_padding * 2; end; def col_max; 4; end; def top_col; ox / (item_width + spacing); end; #----------------------------------------------------------------------------- # * top_col= #----------------------------------------------------------------------------- def top_col=(col) col = 0 if col < 0 col = col_max - 1 if col > col_max - 1 self.ox = (index / col_max).ceil * (item_width + spacing) * col_max calc_new_x end #----------------------------------------------------------------------------- # * calc_new_x #----------------------------------------------------------------------------- def calc_new_x return if self.ox == @temp_ox @temp_ox = self.ox @layout.each do |layout| layout.ox = self.ox end @face.each do |face| face.ox = self.ox end end #----------------------------------------------------------------------------- # * ensure_cursor_visible #----------------------------------------------------------------------------- def ensure_cursor_visible self.top_col = ((index + 1) / col_max).floor * col_max end #----------------------------------------------------------------------------- # * item_rect #----------------------------------------------------------------------------- def item_rect(index) rect = super rect.x = index * (item_width + spacing) rect.y = 0 rect end #----------------------------------------------------------------------------- # * draw_item #----------------------------------------------------------------------------- def draw_item(index) draw_layout(index) actor = $game_party.members[index] enabled = $game_party.battle_members.include?(actor) rect = item_rect(index) draw_item_background(index) x = rect.x + (rect.width-96)/2 y = rect.y - 4 color = Color.new(0,0,0,140) color2 =Color.new(0,0,0,200) #Fill Rect behind Name contents.fill_rect(x-4, y + line_height / 3 + 4, 104, 22, color) #Make Border around Face contents.fill_rect(x-4, rect.y + line_height * 1 + 8, 104, 100, color2) contents.clear_rect(x-2, rect.y + line_height * 1 + 10, 100, 96) #Fill Rect behind the Gauges contents.fill_rect(x-4, y +line_height * 1.5 + 102, 104, 66, color) #Draw the things if Eugene222::MConfig::CustomFace draw_actor_custom_face(index, actor) else draw_actor_face(actor, x, rect.y + line_height * 1 + 10, enabled) end draw_actor_simple_status(actor, x , y) end #----------------------------------------------------------------------------- # * draw_actor_custom_face #----------------------------------------------------------------------------- def draw_actor_custom_face(index, actor) @face[index].dispose if @face[index] enabled = $game_party.battle_members.include?(actor) @face[index] = Sprite.new @face[index].bitmap = Cache.menu("#{actor.name}_face") rescue nil @face[index].x = index * (item_width + spacing) + 18 @face[index].ox = self.ox @face[index].opacity = enabled ? 255 : translucent_alpha @face[index].y = self.y + 1 / col_max * item_height + 22 @face[index].z = self.z - 1 end #----------------------------------------------------------------------------- # * draw_layout #----------------------------------------------------------------------------- def draw_layout(index) @layout[index].dispose if @layout[index] @layout[index] = Sprite.new @layout[index].bitmap = Cache.menu("status_bg") rescue nil @layout[index].ox = self.ox @layout[index].x = index * (item_width + spacing) + 4 @layout[index].y = self.y + 1 / col_max * item_height + 4 @layout[index].z = self.z - 3 end #----------------------------------------------------------------------------- # * draw_actor_simple_status #----------------------------------------------------------------------------- def draw_actor_simple_status(actor, x, y) draw_actor_name(actor, x-2, y + line_height / 3 +4, 102) draw_actor_icons(actor, x, y + line_height* 1.5 + 104, 96) contents.font.size = 20 draw_actor_hp(actor, x-2, y + line_height * 2.5 + 102, 100) draw_actor_mp(actor, x-2, y + line_height * 3.25 + 102, 100) draw_actor_exp(actor,x-2, y + line_height * 1.0 + 90, 100) end #----------------------------------------------------------------------------- # * draw_actor_level #----------------------------------------------------------------------------- def draw_actor_level(actor, x, y) change_color(system_color) draw_text(x, y, 24, line_height, Vocab::level_a) change_color(normal_color) draw_text(x + 24, y, 16, line_height, actor.level, 2) end #----------------------------------------------------------------------------- # * draw_current_and_max_values #----------------------------------------------------------------------------- def draw_current_and_max_values(x, y, width, current, max, color1, color2) change_color(color1) xr = x + width draw_text(xr - 84, y, 42, line_height, current, 2) change_color(color2) draw_text(xr - 46, y, 12, line_height, "/", 2) draw_text(xr - 42, y, 42, line_height, max, 2) end #----------------------------------------------------------------------------- # * draw_actor_exp #----------------------------------------------------------------------------- def draw_actor_exp(actor, x, y, width = 124) exp_now = actor.exp-actor.current_level_exp exp_need = actor.next_level_exp.to_f-actor.current_level_exp exp = (exp_now.to_f/100)/(exp_need.to_f/100) unless actor.max_level? exp_rate = exp exp_text = "#{(exp*100).to_i}%" else exp_rate = 1 exp_text = "MAX" end draw_gauge(x, y, width, exp_rate, tp_gauge_color1, tp_gauge_color2) draw_actor_level(actor, x, y) draw_text(x + width - 42, y, 42, line_height, exp_text , 2) end #----------------------------------------------------------------------------- # * draw_gauge #----------------------------------------------------------------------------- def draw_gauge(x, y, width, rate, color1, color2) fill_w = (width * rate).to_i gauge_y = y + line_height - 8 contents.fill_rect(x, gauge_y, width, 4, gauge_back_color) contents.gradient_fill_rect(x, gauge_y, fill_w, 4, color1, color2) end #----------------------------------------------------------------------------- # * dispose #----------------------------------------------------------------------------- def dispose super dispose_face dispose_layout end #----------------------------------------------------------------------------- # * dispose_layout #----------------------------------------------------------------------------- def dispose_layout return unless @layout @layout.each do |layout| layout.bitmap.dispose if layout.bitmap.dispose layout.dispose end @layout = nil end #----------------------------------------------------------------------------- # * dispose_face #----------------------------------------------------------------------------- def dispose_face return unless @face @face.each do |face| face.bitmap.dispose if face.bitmap face.dispose end @face = nil end #-----------------------------------------------------------------------------end#==============================================================================# ** new Window_Information# methods: initialize, draw_gold, draw_steps, draw_battle_won, draw_time,# update#==============================================================================class Window_Information < Window_Base #----------------------------------------------------------------------------- include Eugene222::MConfig #----------------------------------------------------------------------------- # * initialize #----------------------------------------------------------------------------- def initialize super(0,Graphics.height-72,Graphics.width, 72) self.opacity = 0 update end #----------------------------------------------------------------------------- # * draw_gold #----------------------------------------------------------------------------- def draw_gold draw_text(0, 12, contents_width/4 - 46, line_height, $game_party.gold, 2) draw_icon(GoldIcon, contents_width/4 - 45, 12) end #----------------------------------------------------------------------------- # * draw_steps #----------------------------------------------------------------------------- def draw_steps draw_text(contents_width/4, 12, contents_width/4-46, line_height, $game_party.steps, 2) draw_icon(StepIcon, contents_width*2/4 - 45, 12) end #----------------------------------------------------------------------------- # * draw_battle_won #----------------------------------------------------------------------------- def draw_battle_won draw_text(contents_width*2/4, 12, contents_width/4-46, line_height, $game_system.battle_won_count, 2) draw_icon(BattleIcon, contents_width*3/4 - 45, 12) end #----------------------------------------------------------------------------- # * draw_time #----------------------------------------------------------------------------- def draw_time draw_text(contents_width*3/4, 12, contents_width/4-26, line_height, $game_system.playtime_s, 2) draw_icon(TimeIcon, contents_width - 25, 12) end #----------------------------------------------------------------------------- # * update #----------------------------------------------------------------------------- def update super contents.clear draw_gold draw_steps draw_battle_won draw_time end #-----------------------------------------------------------------------------end#==============================================================================# ** Scene_Menu# new_methods: create_information_window, custom_command#==============================================================================class Scene_Menu < Scene_MenuBase #----------------------------------------------------------------------------- # * start #----------------------------------------------------------------------------- def start super @info = Eugene222::MConfig:😀C @help_window = Window_Menu.new(2) @help_window.opacity = 0 create_command_window create_status_window create_information_window end #----------------------------------------------------------------------------- # * create_command_window #----------------------------------------------------------------------------- def create_command_window @command_window = Window_MenuCommand.new(0,@help_window.height-12) @command_window.help_window = @help_window @info.each do |k,v| @command_window.set_handler(k, method(v[3])) if v[0] end @command_window.set_handler🙂cancel, method🙂return_scene)) end #----------------------------------------------------------------------------- # * create_information_window #----------------------------------------------------------------------------- def create_information_window @information_window = Window_Information.new end #----------------------------------------------------------------------------- # * create_status_window #----------------------------------------------------------------------------- def create_status_window @status_window = Window_NewMenuStatus.new(0, @command_window.height*2 - 24 ) end #----------------------------------------------------------------------------- # * custom_command #----------------------------------------------------------------------------- def custom_command SceneManager.call(@command_window.current_ext) end #-----------------------------------------------------------------------------end#==============================================================================# ** Cache# new method: self.menu#==============================================================================module Cache #----------------------------------------------------------------------------- # * self.menu #----------------------------------------------------------------------------- def self.menu(filename) load_bitmap("Graphics/Menu/", filename) end #-----------------------------------------------------------------------------end#==============================================================================# ** BattleManager# alias Method: self.process_victory#==============================================================================module BattleManager class << self alias eugene222_process_vicotory process_victory #--------------------------------------------------------------------------- # * self.process_victory #--------------------------------------------------------------------------- def process_victory $game_system.battle_won_count += 1 eugene222_process_vicotory end end #-----------------------------------------------------------------------------end#==============================================================================# ** Game_System# alias Method: initialize# new attr_accessor: battle_won_count#==============================================================================class Game_System #----------------------------------------------------------------------------- attr_accessor :battle_won_count #----------------------------------------------------------------------------- alias eugene222_game_system_initialize initialize #----------------------------------------------------------------------------- # * initialize #----------------------------------------------------------------------------- def initialize @battle_won_count = 0 eugene222_game_system_initialize end #-----------------------------------------------------------------------------end#===============================================================================#-------------------------------------------------------------------------------# ** SCRIPT END **#-------------------------------------------------------------------------------#===============================================================================
I think the class that slow down the loading time is the class which starts at Line 352.

But Im not sure, maybe it have other reasons.

Thanks for every help here.

mfG
The lag is caused by the redrawing of every image in the menu per frame. Draw everything only once if possible; animated things can be drawn when necessary. It is never a good idea to draw everything each frame.
Hmm, I dont get it. I though I draw it only once. Can you explain it a more deeply?
Well, perhaps I misread your script a bit. What I'm talking about though is your update method in Window_Information:

def update super contents.clear draw_gold draw_steps draw_battle_won draw_timeendThe only thing here you need to update is the time, I think. You can just call contents.clear_rect(rect_where_time_is_drawn) and then just draw the time again.Also, why not just put the background sprites in Scene_Menu? They don't really belong in a Window_* class.

EDIT: Actually, I think you are missing the point of the Window_* classes entirely. You don't create Sprite objects in them, you "blit", or "paste" images upon them. For instance, instead of creating sprites for each command, you would load the image up (image = Cache.menu(icon_name)) and then blit it onto contents, like so:

Code:
contents.blt(x, y, icon, icon.rect)
The multitude of sprites is possibly / probably what is lagging the menu out.
Yeah this is how i wanted to make it.

But the Problem was, that I wanted to make the dark transparent rects behind the name, and the gauges, and It dont worked. It have just override the things behind the rect.

https://www.dropbox.com/s/723ex10eycifj9o/screen1.png

Thats what I wanted it to look like.

But when I had the papyrus background image in contents, and after that make .fillrect, the rect have overriden the papyrus background. I just couldn't figure out why.

So if there is a possibility to have Layers in Contents it would solve my problems.

And to the update part, yes i only want the time to update, but I couldnt figure out how.

clear_rect is perfekt, thank you!

And the menu isn't laggy, it just need some time to open. On my PC it opens instantly but some people say, that they need some time to load it.
Ah, only when it opens? Perhaps you could throw together a system where images are loaded in real time, not all at load...for instance, the menu is visible, but images are popping up one by one, piece by piece, using Thread? I don't really see why your menu takes so long to 'boot' up...I still think it might be the sprites thing.


As for the rect overriding the papyrus image, make the rect -first-, then draw in the image over it. Order is key when working with bitmaps and blt'ing.
Also, when working with Sprites objects you can easily arrange them how you like with the z properity.
Yeah that i can arrange them with z, i knew, thats the whole reason for me to using sprites and not the contents of the window.

But thanks for helping me out both.

FenixFyreXBut is it possible to draw, more things above each other and work with opacity?

For me it didnt work.
The help file explains it directly; you have an optional argument that you can pass to Bitmap#blt, opacity. It allows you to draw images on a bitmap at a certain opacity.

As for the rectangles above the papyrus and below the name / stats, you could easily just Bitmap#fill_rect(x, y, width, height, Color.new(0, 0, 0, 128))...aka yes you can draw bitmaps on top of bitmaps at different opacities, etc. You just have to draw the bottom-most image first, then the next, and finally the top ("closest" to the player) image, like this:

# just for clarity's sakebitmap = self.contents# first image pasted on the bitmap, farthest backpap = Cache.menu("Papyrus")bitmap.blt(20, 20, pap, pap.rect)trans_black = Color.new(0, 0, 0, 128)# next layer; two transparent black rects on top of papyrus imagebitmap.fill_rect(20, 20, pap.width, 20, trans_black)bitmap.fill_rect(20, pap.height - 20, pap.width, 20, trans_black)# next layer; face icon drawn on left underneath name (which isn't drawn yet)trans_img = Cache.menu("CharacterFace")bitmap.blt(20, 20, trans_img, trans_img.rect, 128) # transparent icon of character's face# next layer; text and hp bar on top of transparent black rectsbitmap.draw_text(20, 20, pap.width, 20, "CharacterName", 1)draw_hp(20, pap.height - 20, pap.width, 20, character)# last layer; face in middle of papyrus image, above everythingdraw_face(pap.width/2 - 48, pap.height/2 - 48, character)Perhaps you need to look at the help file a bit more 😛 It's all in there, just search bitmap.EDIT: Also to clarify my explanation earlier, it is not bad to use sprites to create a menu system; however it is bad practice to create and manage these sprites in an instance of a window class unless for good reason. There is no need for it.
Yeah I think I need to look into the help file more^^ Haha but anyway thank you. I will rewrite my code a bit. And hopefully it will be a bit faster after that.
What you also could do is to use this script, it will make so the images caches the first time and is ready for use the next time the scene opens.
So i wanted to remove all sprites today and make it work with contents only.

But it dont work, it is how i mentioned it before:



Thats the code:

rect = item_rect(index)color = Color.new(0,0,0,128)bitmap = Cache.menu("status_bg")contents.blt(0,0,bitmap,rect)contents.fill_rect(x-4, y + line_height / 3 + 4, 104, 22, color)contents.fill_rect(x-4, y +line_height * 1.5 + 102, 104, 66, color)  I think its the correct order, at firtst the papyrus image and after that the transparent rects.

Original thread: https://forums.rpgmakerweb.com/threads/improve-load-time.18569/