Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Scene_Base
- alias :th_animated_windows_pre_terminate :pre_terminate
- def pre_terminate
- th_animated_windows_pre_terminate
- update_closing_animations
- end
- def update_closing_animations
- windows = []
- instance_variables.each do |varname|
- ivar = instance_variable_get(varname)
- if ivar.is_a?(Window)
- ivar.closing_animation
- windows.push(ivar)
- end
- end
- animating = true
- while animating
- animating = false
- Graphics.update
- Input.update
- windows.each {|window|
- window.update
- animating = true if window.animating?
- }
- end
- end
- end
- class Window_MenuCommand < Window_Command
- def opening_animation
- self.opacity = 0
- @new_opacity = 255
- @fade_speed = 10
- @slide_speed = 12
- @new_x = self.x
- self.x = self.x - self.width
- end
- def closing_animation
- @new_x = self.x + Graphics.width
- @slide_speed = 50
- @fade_speed = 15
- @new_opacity = 0
- end
- end
- class Window_Gold < Window_Base
- def opening_animation
- self.opacity = 0
- @new_opacity = 255
- @fade_speed = 10
- @slide_speed = 12
- @new_y = Graphics.height - self.height
- self.y = Graphics.height
- end
- def closing_animation
- @slide_speed = 50
- @fade_speed = 15
- @new_opacity = 0
- @new_y = self.y - Graphics.height
- end
- end
- class Window_MenuStatus < Window_Selectable
- def opening_animation
- self.opacity = 0
- @new_opacity = 255
- @fade_speed = 10
- @new_x = self.x
- @slide_speed = 40
- self.x = self.x + self.width
- end
- def closing_animation
- @slide_speed = 50
- @fade_speed = 15
- @new_opacity = 0
- @new_x = self.x - Graphics.width
- end
- end
- class Scene_Menu < Scene_MenuBase
- #why would you re-position it after you create it?
- def create_gold_window
- @gold_window = Window_Gold.new
- #~ @gold_window.x = 0
- #~ @gold_window.y = Graphics.height - @gold_window.height
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement