Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

[VX] Animated Window Skin

Animated Window Skin
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

 
You can change these variables for every windows. So, if you don't want Window_Help's skin to be animated, simply add @animated_skin = false in the initialize method.
  • 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
 

Taylor

Sponsor

Odd, why does this try to use RGSS200E.dll? I have RGSS202E.dll o_@. I had to change it to that in the Game.ini to get the demo to start.
 
Odd indeed, I' don't have any RGSS200E.dll. Hmmm, nop, only 200J, 202E and 202J.

Edit: Looks like RGSS200E.dll comes from the trial version.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top