Mithran

Fade additions update

Feb 9th, 2012
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.41 KB | None | 0 0
  1.  
  2. # fade additions update
  3. class Scene_Map
  4.  
  5. def perform_battle_transition
  6. #~ Graphics.transition(80, "Graphics/System/BattleStart", 80)
  7. #~ Graphics.freeze
  8. end
  9.  
  10. def terminate
  11. super
  12. #~ if $scene.is_a?(Scene_Battle) # If switching to battle screen
  13. #~ @spriteset.dispose_characters # Hide characters for background creation
  14. #~ end
  15. if $scene.is_a?(Scene_Battle) # If switching to battle screen
  16. snapshot_for_background_battle
  17. else
  18. snapshot_for_background
  19. end
  20. @spriteset.dispose
  21. @message_window.dispose
  22. if $scene.is_a?(Scene_Battle) # If switching to battle screen
  23. perform_battle_transition # Execute pre-battle transition
  24. end
  25. end
  26. end
  27.  
  28. class Scene_Battle
  29.  
  30. alias jet3734_start start
  31. def start
  32. Graphics.transition(0)
  33. jet3734_start
  34. end
  35.  
  36. def perform_transition
  37. end
  38. end
  39.  
  40. class Scene_Map
  41. def snapshot_for_background_battle
  42. $game_temp.background_bitmap.dispose
  43. $game_temp.background_bitmap = Graphics.snap_to_bitmap
  44. $game_temp.orig_background_bitmap = Graphics.snap_to_bitmap
  45. $game_temp.background_bitmap.blur
  46. end
  47. end
  48.  
  49. #~ class Scene_Battle
  50.  
  51. #~ def terminate
  52. #~ super
  53. #~ dispose_info_viewport
  54. #~ @message_window.dispose
  55. #~ @ctb_right.dispose
  56. #~ Graphics.transition(0)
  57. #~ @spriteset.dispose
  58. #~ $transition_battle = true
  59. #~ unless $scene.is_a?(Scene_Gameover)
  60. #~ $scene = nil if $BTEST
  61. #~ end
  62. #~ end
  63. #~
  64.  
  65.  
  66. #~
  67. #~ end
  68.  
  69. class Spriteset_Battle
  70.  
  71. def end_fade
  72.  
  73. Graphics.freeze
  74. @battleback_sprite.bitmap.dispose
  75. @battleback_sprite.bitmap = $game_temp.orig_background_bitmap
  76. @battleback_sprite.tone = Tone.new(0, 0, 0, 0)
  77. Graphics.transition(60)
  78. return
  79. tone = @battleback_sprite.tone
  80. tone_target = Tone.new(0, 0, 0, 0)
  81. @duration = BattleBack::MAP_FADE_TIME
  82. loop {
  83. if @duration > 0
  84. d = @duration
  85. tone.red = (tone.red * (d - 1) + tone_target.red) / d
  86. tone.green = (tone.green * (d - 1) + tone_target.green) / d
  87. tone.blue = (tone.blue * (d - 1) + tone_target.blue) / d
  88. tone.gray = (tone.gray * (d - 1) + tone_target.gray) / d
  89. @duration -= 1
  90. @battleback_sprite.tone = tone
  91. Graphics.update
  92. else
  93. break
  94. end
  95. }
  96. end
  97.  
  98. end
  99.  
  100. class Game_Temp
  101. attr_accessor :orig_background_bitmap
  102. end
Advertisement
Add Comment
Please, Sign In to add comment