[VX Ace] Help me with my custom battle transition

Hey , guy I ran into trouble again.
I just tries to make my custom battle transition on VX Ace. but somehow it's end up like freeze screen and with grey screen on battle.
aweed.png

I just wanted to be like this.

here is a code, I have written.
Ruby:
module YaiDek
 
  def self.init()
      @list_sprite = []
  end
 
   def self.update(i)
      current_frame = Graphics.snap_to_bitmap
      current_viewport = Viewport.new
      current_viewport.z = 420
      current_viewport.color = Color.new(2 * i,2 * i,2 * i,255)
      sprite = Sprite.new(current_viewport)
      sprite.bitmap = current_frame.clone
      sprite.zoom_y = 1 + 0.2 * i
      sprite.zoom_x = 1 + 0.2 * i
      sprite.angle = 4 * i
      @list_sprite.push(sprite)
      current_frame.dispose
   end
 
   def self.destroy()
      return if !disposed?
      @list_sprite.each {|sprite| sprite.dispose}
      @viewport.dispose if @viewport
      @list_sprite = nil
   end
 
   def self.disposed?
    !@list_sprite
   end
 
end


class Scene_Map < Scene_Base
 
  def perform_battle_transition
    YaiDek.init()
     (0..60).each do |i|
        Graphics.frame_reset
        YaiDek.update(i)
        Graphics.update
     end
     Graphics.freeze
     YaiDek.destroy()
  end

 
end
What did I do wrong?
edit: also why the heck is Graphics.snap_to_bitmap , Always return blank screen??
I may have misunderstood your objective, but when I used a battle transition from the map I went about it in a completely different way.

Perhaps try something like this
1661444161326.png
I may have misunderstood your objective, but when I used a battle transition from the map I went about it in a completely different way.

Perhaps try something like this
View attachment 238802
not, something like this.
can you test the script I written? why it's was freeze and grey at the end of transition.
can you test the script I written?
No, I can't. I'm not a proper scripter.
Ok I solved. all problem. about my custom transition thanks.

Original thread: https://forums.rpgmakerweb.com/threads/vx-ace-help-me-with-my-custom-battle-transition.150797/