# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# RGSS3 - Bounce Window# Author: Soulpour777# Version 1.0# Web URL: infinitytears.wordpress.com# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# Description: Creates a bouncing effect on your windows. It would bounce# except if its a message.# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=module Soulpour module Bounce # If you want to show map names, the switch must be true. Which ID of the # switch should hold the map name? Restore_Map_Switch = 1 # Original Opacity of the Window. Original_Opacity = 0 # Opacity of the Window Contents when showing them. Content_Opacity = 255 endendclass Window_Base < Window include Soulpour::Bounce alias :soul_bounce_the_windows_for_me_but_initialize_first :initialize alias :soul_bounce_the_windows_for_me_but_update_first :update #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize(x, y, width, height) soul_bounce_the_windows_for_me_but_initialize_first(x, y, width, height) @bounce_effect_stop = (self.is_a?(Window_Message) or $game_party.in_battle) self.opacity = self.contents_opacity = Original_Opacity unless @bounce_effect_stop end #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update soul_bounce_the_windows_for_me_but_update_first unless @bounce_effect_stop if @opening @bounce_effect_stop = true self.opacity = self.contents_opacity = Content_Opacity else unless @bounce_effect_start @bounce_effect_start = true @bounce_effect_by = self.y @bounce_effect_sy, @bounce_effect_vy = rand(32768) + 65536, 0 end self.y = @bounce_effect_by - ((@bounce_effect_sy -= (@bounce_effect_vy += 128)) >> 10) if self.y > @bounce_effect_by @bounce_effect_sy, @bounce_effect_vy = 0, (0 - @bounce_effect_vy) / 2 self.y = @bounce_effect_by end self.opacity = self.contents_opacity = self.opacity + 16 end end end endclass Scene_Map < Scene_Base include Soulpour::Bounce #-------------------------------------------------------------------------- # * Create Map Name Window #-------------------------------------------------------------------------- def create_location_window @map_name_window = Window_MapName.new if $game_switches[Restore_Map_Switch] endend