Advertisement
Guest User

Untitled

a guest
Oct 10th, 2014
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.01 KB | None | 0 0
  1. class Scene_Base
  2.  
  3. alias :th_animated_windows_pre_terminate :pre_terminate
  4. def pre_terminate
  5. th_animated_windows_pre_terminate
  6. update_closing_animations
  7. end
  8.  
  9. def update_closing_animations
  10. windows = []
  11. instance_variables.each do |varname|
  12. ivar = instance_variable_get(varname)
  13. if ivar.is_a?(Window)
  14. ivar.closing_animation
  15. windows.push(ivar)
  16. end
  17. end
  18.  
  19. animating = true
  20. while animating
  21. animating = false
  22. Graphics.update
  23. Input.update
  24. windows.each {|window|
  25. window.update
  26. animating = true if window.animating?
  27. }
  28. end
  29. end
  30. end
  31.  
  32. class Window_MenuCommand < Window_Command
  33.  
  34. def opening_animation
  35. self.opacity = 0
  36. @new_opacity = 255
  37. @fade_speed = 10
  38. @slide_speed = 12
  39. @new_x = self.x
  40. self.x = self.x - self.width
  41. end
  42.  
  43. def closing_animation
  44. @new_x = self.x + Graphics.width
  45. @slide_speed = 50
  46. @fade_speed = 15
  47. @new_opacity = 0
  48. end
  49. end
  50.  
  51. class Window_Gold < Window_Base
  52.  
  53. def opening_animation
  54. self.opacity = 0
  55. @new_opacity = 255
  56. @fade_speed = 10
  57. @slide_speed = 12
  58. @new_y = Graphics.height - self.height
  59. self.y = Graphics.height
  60. end
  61.  
  62. def closing_animation
  63. @slide_speed = 50
  64. @fade_speed = 15
  65. @new_opacity = 0
  66. @new_y = self.y - Graphics.height
  67. end
  68. end
  69.  
  70. class Window_MenuStatus < Window_Selectable
  71. def opening_animation
  72. self.opacity = 0
  73. @new_opacity = 255
  74. @fade_speed = 10
  75. @new_x = self.x
  76. @slide_speed = 40
  77. self.x = self.x + self.width
  78. end
  79.  
  80. def closing_animation
  81. @slide_speed = 50
  82. @fade_speed = 15
  83. @new_opacity = 0
  84. @new_x = self.x - Graphics.width
  85. end
  86. end
  87.  
  88. class Scene_Menu < Scene_MenuBase
  89.  
  90. #why would you re-position it after you create it?
  91. def create_gold_window
  92. @gold_window = Window_Gold.new
  93. #~ @gold_window.x = 0
  94. #~ @gold_window.y = Graphics.height - @gold_window.height
  95. end
  96. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement