by Dargor
Version 1.1
Introduction
Something new here! As the title says, this script let you have an animated window skin. To do so, you have to edit some variables in your windows.
Code:
Â
# Window skin name
@original_skin = "Window"
# Is the skin animated?
@animated_skin = true
# Current animation frame
@frame = 0
# Maximum frames
@frame_max = 4
# Duration of each frames
@duration = 12
Â
- Note that you must have as much windowskin files in the Graphics\System directory as the @frame_max value.
- The @original_skin variable is the name of the windowskin file.
- The @duration variable is the duration in frames between each animation frames
Here's an exemple of how to animate a windowskin:
@frame_max = 4 and @original_skin = "Window". This means that you must have 4 windowskin files in your Graphics\System directory named this way:
Window1
Window2
Window3
Window4
Maybe it's a bit complicated? :crazy:
Then here's a demo! http://rapidshare.com/files/98013836/Da ... d.exe.html
Script
Code:
#==============================================================================
# ** Animated Window Skin
#------------------------------------------------------------------------------
#  © Dargor, 2008
# Â 26/03/08
# Â Version 1.1
#------------------------------------------------------------------------------
# Â VERSION HISTORY:
# Â - 1.0 (08/03/08), Initial release
# Â - 1.1 (26/03/08), Lag reduction
#------------------------------------------------------------------------------
# Â INSTRUCTIONS:
# Â - Paste this above main
# Â - Edit the variables in Window_Base, under initialize
#==============================================================================
Â
#==============================================================================
# ** Window_Base
#------------------------------------------------------------------------------
# Â This is a superclass of all windows in the game.
#==============================================================================
Â
class Window_Base < Window
 #--------------------------------------------------------------------------
 # * Alias Listing
 #--------------------------------------------------------------------------
 alias dargor_vx_animated_window_skin_initialize initialize
 alias dargor_vx_animated_window_skin_update update
 #--------------------------------------------------------------------------
 # * Object Initialization
 #   x    : window x-coordinate
 #   y    : window y-coordinate
 #   width  : window width
 #   height : window height
 #--------------------------------------------------------------------------
 def initialize(x, y, width, height)
  dargor_vx_animated_window_skin_initialize(x, y, width, height)
  # Window skin name
  @original_skin = "Window_Lava"
  # Is the skin animated?
  @animated_skin = false
  # Current animation frame
  @frame = 0
  # Maximum frames
  @frame_max = 3
  # Duration of each frames
  @duration = 12
 end
 #--------------------------------------------------------------------------
 # * Frame Update
 #--------------------------------------------------------------------------
 def update
  dargor_vx_animated_window_skin_update
  if @animated_skin
   @frame = (@frame + 1) % (@duration * @frame_max)
   index = (@frame / @duration) + 1
   set_animated_skin_index(index)
  end
 end
 #--------------------------------------------------------------------------
 # * Reset Animated Skin
 #--------------------------------------------------------------------------
 def reset_animated_skin
  if @animated_skin
   self.windowskin = Cache.system("#{@original_skin}1")
  end
 end
 #--------------------------------------------------------------------------
 # * Set Animated Skin Id
 #   id : id of windowskin
 #--------------------------------------------------------------------------
 def set_animated_skin_index(index)
  if @animated_skin and self.visible
   self.windowskin = Cache.system("#{@original_skin}#{index}")
  end
 end
end
Notes
Don't forget to give me credit!
-Dargor