Advertisement
neutale

Portrait Focus Background

Nov 10th, 2018
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 3.47 KB | None | 0 0
  1. #==============================================================================
  2. #                   「Portrait Focus Background」(ACE) Ver.1.0
  3. #   Author: Nana
  4. #   Homepage: http://heptanas.mamagoto.com/
  5. #
  6. #   ◇Terms of Use
  7. #   Please credit "Nana."
  8. #   Feel free to modify this script and/or distribute it.
  9. #   Also please include the credit in the readme or somewhere it's accessible. (Not from credit roll)
  10. #   Check the blog for detailed terms of use.
  11. #
  12. #------------------------------------------------------------------------------
  13. #  
  14. #   Capture the background of the map screen (also a background of the menu)
  15. #   Which is displayed behind the window and picture before the map screen.
  16. #  
  17. #   Using windows and pictures, you can express things with menu screens.
  18. #   Also you can change the blur and color.
  19. #  
  20. #   [How to use]
  21. #   Use "Script" from the Event Commands
  22. #  
  23. #   n7_create_background        create a background
  24. #   n7_dispose_background       remove a background
  25. #  
  26. #   n7_create_background(blur, [R, G, B, alpha])
  27. #       blur:true/false to set blur
  28. #       [R, G, B, alpha]: to set color through 0~255 RGB color code
  29. #  
  30. #==============================================================================
  31.  
  32.  
  33. #==============================================================================
  34. # ■ Scene_Map
  35. #------------------------------------------------------------------------------
  36. #  Scene Map Process
  37. #==============================================================================
  38.  
  39. class Scene_Map < Scene_Base
  40.   #--------------------------------------------------------------------------
  41.   # ● Create background
  42.   #--------------------------------------------------------------------------
  43.   def create_background(blur, color)
  44.     @background_sprite = Sprite.new
  45.     @background_sprite.bitmap = Graphics.snap_to_bitmap
  46.     @background_sprite.bitmap.blur if blur
  47.     @background_sprite.color.set(color)
  48.   end
  49.   #--------------------------------------------------------------------------
  50.   # ● Dispose background
  51.   #--------------------------------------------------------------------------
  52.   def dispose_background
  53.     @background_sprite.dispose
  54.   end
  55.   #--------------------------------------------------------------------------
  56.   # ● Dispose spriteset
  57.   #--------------------------------------------------------------------------
  58.   alias dispose_spriteset_bg dispose_spriteset
  59.   def dispose_spriteset
  60.     dispose_spriteset_bg
  61.     @background_sprite.dispose if @background_sprite
  62.   end
  63. end
  64.  
  65. #==============================================================================
  66. # ■ Game_Interpreter
  67. #------------------------------------------------------------------------------
  68. #  Game interpreter for classes like Game_Map,
  69. #  Game_Troop、and Game_Event.
  70. #==============================================================================
  71.  
  72. class Game_Interpreter
  73.   #--------------------------------------------------------------------------
  74.   # ● Create background
  75.   #--------------------------------------------------------------------------
  76.   def n7_create_background(blur = true, rgba = [16, 16, 16, 128])
  77.     SceneManager.scene.create_background(blur, Color.new(*rgba))
  78.   end
  79.   #--------------------------------------------------------------------------
  80.   # ● Dispose background
  81.   #--------------------------------------------------------------------------
  82.   def n7_dispose_background
  83.     SceneManager.scene.dispose_background
  84.   end
  85. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement