Window Animation Designer

This script provides animation properties that allow you to easily design window animations. Rather than writing how the animation should be performed, you simply write what you expect it to do, and this designer handles the animation for you!


 
There are two types of animations

  • opening animations
  • closing animations
Opening animations are run whenever a window is opened, while closing animations are run whenever a window is closed. 
The following animation options are available, which you can use to design your animations

  • Window moving
  • Window resizing
  • Window fading
Download

Get it at Hime Works!
Looks very interesting, pretty basic. I shall be one of your testers.

Edit:

Just wanna note for those who use it, you basically have to define different default X/Y values for the default engine windows + the windows for whatever custom scenes you want to use this for, and this use this script's stuff to define the new locations/settings.

Like for example if I want my window menu command to slide from right to left, I have to change it's default location if window_menucommand and then add the new location animation after slide.

window_menucommand (160 px size) new default: x = 384 (normally x = 0)

open animation x = 0

close animation x = 384

Note that I am speaking in pseudo-terms.

Oh one more thing, in the script it has open_animation and close_animation already for Window_base, but it's left blank with no options. Putting options in there will affect ALL windows. (title screen, menus, showTexts, etc)  I highly advise not touching this for Window_Base
This is glorious. You did improve the nice VX feature of opening windows and took it to the next level. Very cool!

Salut,

Orochii Zouveleki
Just wanna note for those who use it, you basically have to define different default X/Y values for the default engine windows + the windows for whatever custom scenes you want to use this for, and this use this script's stuff to define the new locations/settings.


Like for example if I want my window menu command to slide from right to left, I have to change it's default location if window_menucommand and then add the new location animation after slide.
This is an important point, which I left out in my usage details.


Basically, we can think of the default windows as having their own animations. When you open the menu, the windows fade-in on the spot, and when you close the menu, the windows fade out. If your own animations require the windows to be placed outside of the screen initially, they will need to be adjusted as mentioned.


I have added this to the instructions.
My addons to allow expanding and collapsing windows.
Spoiler: Window Animation Designer addon
Ruby:
# ╔═══════════════════════════════════════════════╦════════════════════╗
# ║ Title: Window Animation Designer - Addon      ║  Version: 1.00     ║
# ║ Author: Roninator2                            ║                    ║
# ╠═══════════════════════════════════════════════╬════════════════════╣
# ║ Function:                                     ║   Date Created     ║
# ║                                               ╠════════════════════╣
# ║   Provides an additional method of animation  ║    08 Apr 2024     ║
# ╚═══════════════════════════════════════════════╩════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Requires: Hime Window Animation Designer                           ║
# ║                                                                    ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Brief Description:                                                 ║
# ║         Allow Expanding and Collapsing windows                     ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Instructions:                                                      ║
# ║   Place after Hime Window Animation Designer                       ║
# ║   Configure settings for each window in add on scripts             ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Updates:                                                           ║
# ║ 1.00 - 08 Apr 2024 - Script finished                               ║
# ║                                                                    ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Credits and Thanks:                                                ║
# ║   Roninator2                                                       ║
# ║   TsukiHime                                                        ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Terms of use:                                                      ║
# ║  Follow the original Authors terms of use where applicable         ║
# ║    - When not made by me (Roninator2)                              ║
# ║  Free for all uses in RPG Maker except nudity                      ║
# ║  Anyone using this script in their project before these terms      ║
# ║  were changed are allowed to use this script even if it conflicts  ║
# ║  with these new terms. New terms effective 03 Apr 2024             ║
# ║  No part of this code can be used with AI programs or tools        ║
# ║  Credit must be given                                              ║
# ╚════════════════════════════════════════════════════════════════════╝

class Window_Base < Window
 
  alias r2_animated_window_initialize initialize
  def initialize(x, y, width, height)
    @expanding = [false,false,false,false]
    @colapsing = [false,false,false,false]
    r2_animated_window_initialize(x, y, width, height)
  end

  def update_position
    @animating = false
    if @expanding.any? { |ex| ex == true }
      update_expand
    elsif @colapsing.any? { |cl| cl == true }
      update_colapse
    else
      update_x if @new_x && self.x != @new_x
      update_y if @new_y && self.y != @new_y
      update_width if @new_width && self.width != @new_width
      update_height if @new_height && self.height != @new_height
      update_opacity if @new_opacity
    end
  end

  def update_expand
    @animating = true
    expand_x if @expanding[0] == true
    expand_y if @expanding[1] == true
    expand_width if @expanding[2] == true
    expand_height if @expanding[3] == true
  end
 
  def update_colapse
    @animating = true
    colapse_x if @colapsing[0] == true
    colapse_y if @colapsing[1] == true
    colapse_width if @colapsing[2] == true
    colapse_height if @colapsing[3] == true
  end
   
  def redraw_contents
    contents.dispose
    create_contents
    refresh
  end
 
  def expand_x
    if self.x > @new_x
      self.x = self.x - @slide_speed
      @expanding[0] = true
    else
      self.x = @new_x
      @expanding[0] = false
    end
  end
 
  def expand_y
    if self.y > @new_y
      self.y = self.y - @slide_speed
      @expanding[1] = true
    else
      self.y = @new_y
      @expanding[1] = false
    end
  end
 
  def expand_width
    if self.width < @new_width
      self.width = self.width + @slide_speed * 2
      @expanding[2] = true
    else
      self.width = @new_width
      @expanding[2] = false
    end
  end
 
  def expand_height
    if self.height < @new_height
      self.height = self.height + @slide_speed * 2
      @expanding[3] = true
    else
      self.height = @new_height
      @expanding[3] = false
      redraw_contents
    end
  end
 
  def colapse_x
    if self.x < @new_x
      self.x = self.x + @slide_speed
      @colapsing[0] = true
    else
      self.x = @new_x
      @colapsing[0] = false
    end
  end
 
  def colapse_y
    if self.y < @new_y
      self.y = self.y + @slide_speed
      @colapsing[1] = true
    else
      self.y = @new_y
      @colapsing[1] = false
    end
  end
 
  def colapse_width
    if self.width > @new_width
      self.width = self.width - self.width / 10
      @colapsing[2] = true
    else
      self.width = @new_width
      @colapsing[2] = false
    end
  end
 
  def colapse_height
    if self.height > @new_height
      self.height = self.height - self.height / 10
      @colapsing[3] = true
    else
      self.height = @new_height
      @colapsing[3] = false
    end
  end
 
end
Spoiler: Window Animation Designer Config - Expand
Ruby:
# ╔═══════════════════════════════════════════════╦════════════════════╗
# ║ Title: Window Animation Designer - Config     ║  Version: 1.00     ║
# ║ Author: Roninator2                            ║                    ║
# ╠═══════════════════════════════════════════════╬════════════════════╣
# ║ Function:                                     ║   Date Created     ║
# ║                                               ╠════════════════════╣
# ║   Settings for window                         ║    08 Apr 2024     ║
# ╚═══════════════════════════════════════════════╩════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Requires: Hime Window Animation Designer                           ║
# ║           Roninator2 Window Animation Designer addon               ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Brief Description:                                                 ║
# ║           Specify settings for each window                         ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Instructions:                                                      ║
# ║   Detail settings in the code as desired.                          ║
# ║   Windows with a selection require the additional redraw_contents  ║
# ║   Copy the settings and adjust as needed for each window           ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Updates:                                                           ║
# ║ 1.00 - 08 Apr 2024 - Script finished                               ║
# ║                                                                    ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Credits and Thanks:                                                ║
# ║   Roninator2                                                       ║
# ║   TsukiHime                                                        ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Terms of use:                                                      ║
# ║  Follow the original Authors terms of use where applicable         ║
# ║    - When not made by me (Roninator2)                              ║
# ║  Free for all uses in RPG Maker except nudity                      ║
# ║  Anyone using this script in their project before these terms      ║
# ║  were changed are allowed to use this script even if it conflicts  ║
# ║  with these new terms. New terms effective 03 Apr 2024             ║
# ║  No part of this code can be used with AI programs or tools        ║
# ║  Credit must be given                                              ║
# ╚════════════════════════════════════════════════════════════════════╝

class Window_MenuCommand < Window_Command

  def opening_animation
    @expanding[0] = true
    @expanding[1] = true
    @expanding[2] = true
    @expanding[3] = true
    @new_x = self.x
    @new_y = self.y
    @new_width = window_width
    @new_height = window_height
    self.x = @new_x + window_width / 2 - 15
    self.y = @new_y + window_height / 2 - 15
    self.width = 10
    self.height = 30
  end
 
  def closing_animation
    @colapsing[0] = true
    @colapsing[1] = true
    @colapsing[2] = true
    @colapsing[3] = true
    @new_x = self.x + window_width / 2 - 15
    @new_y = self.y + window_height / 2 - 15
    @new_width = 30
    @new_height = 30
  end
 
  def redraw_contents
    contents.dispose
    create_contents
    refresh
    update_cursor
  end
 
end

class Window_Gold < Window_Base
 
  def opening_animation
    @expanding[0] = true
    @expanding[1] = true
    @expanding[2] = true
    @expanding[3] = true
    @new_x = self.x
    @new_y = Graphics.height - self.height
    @new_width = window_width
    @new_height = fitting_height(1)
    self.x = @new_x + window_width / 2 - 15
    self.y = @new_y + fitting_height(1) / 2 - 15
    self.width = 30
    self.height = 30
  end
 
  def closing_animation
    @colapsing[0] = true
    @colapsing[1] = true
    @colapsing[2] = true
    @colapsing[3] = true
    @new_x = self.x + window_width / 2 - 15
    @new_y = self.y + fitting_height(1) / 2 - 15
    @new_width = 30
    @new_height = 30
  end
 
end

class Window_MenuStatus < Window_Selectable
  def opening_animation
    @expanding[0] = true
    @expanding[1] = true
    @expanding[2] = true
    @expanding[3] = true
    @new_x = 160
    @new_y = 0
    @new_width = window_width
    @new_height = window_height
    self.x = @new_x + window_width / 2 - 15
    self.y = @new_y + window_height / 2 - 15
    self.width = 30
    self.height = 30
  end
 
  def closing_animation
    @colapsing[0] = true
    @colapsing[1] = true
    @colapsing[2] = true
    @colapsing[3] = true
    @new_x = self.x + window_width / 2 - 15
    @new_y = self.y + window_height / 2 - 15
    @new_width = 30
    @new_height = 30
  end
 
end
Animation.gif

Original thread: https://forums.rpgmakerweb.com/threads/window-animation-designer.18415/