Advertisement
nio_kasgami

Nio Kasgami Engine Ace "Simple Menu Background control"

Sep 3rd, 2015
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 5.14 KB | None | 0 0
  1. #==============================================================================
  2. # ■ Nio Kasgami Engine Ace "Simple Menu Background control"
  3. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  4. # Kill those damn Blur in the Menu!
  5. # Created by Nio Kasgami.
  6. # Data : 2015/09/3
  7. # Version : 1.0.0
  8. #==============================================================================
  9.  
  10. #==============================================================================
  11. # Terms of use
  12. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  13. # for games usage :
  14. # you have the right to use my system in your games for commercial and
  15. # non-commercial games
  16. # you must credit me
  17. #
  18. # for scripts usage :
  19. # You have the right to use and edit my script in your system.
  20. # but you have to leave the headers unchanged and non-mixed with
  21. # your current scripts. if you decide to share your script to the public
  22. # E.G : Merge my scripts with your scripts.
  23. # {Overwriting method is not count as merge}
  24. #
  25. # you must credit me in your scripts if you use my scripts as base
  26. #
  27. # you don't have the right to redistribute my scripts {non-edit}
  28. # if you want share the thread link.
  29. #
  30. # if you want to use my script as a base for a commercial script,
  31. # please contact me first
  32. #==============================================================================
  33.  
  34. #==============================================================================
  35. # History
  36. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  37. # 2015/05/24 - Begin and finishing the scripts
  38. #==============================================================================
  39.  
  40. #==============================================================================
  41. # Introduction
  42. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  43. # Did you ever wanted to modify the background in your menu but don't wanted
  44. # to use complicate big Menu Engine? Then this script is perfect for you!
  45. #==============================================================================
  46.  
  47. module Nio
  48.   module Blur_Killer
  49.     System ={
  50.     # true   = no blur
  51.     # false  = blur
  52.     :kill_blur => true,
  53.     # true  = Allow color modification
  54.     # false = Disallow color modification
  55.     :enable_color_set => false,
  56.     # set the color (only if enable_color => true)
  57.     #             [red,green,blue,alpha],
  58.     :set_color => [16, 16, 16, 128],
  59.     # set the background type
  60.     # :default = normal map snapshot
  61.     # :custom  = custom picture for background
  62.     :background_type => :custom,
  63.     # set the filename of the background (only if :custom)
  64.     # must be place in Graphics/System
  65.     :bitmap => "Book"
  66.  
  67.     }
  68.   end
  69. end
  70. #==============================================================================
  71. # ■ SceneManager
  72. #------------------------------------------------------------------------------
  73. #  This module manages scene transitions. For example, it can handle
  74. # hierarchical structures such as calling the item screen from the main menu
  75. # or returning from the item screen to the main menu.
  76. #==============================================================================
  77. module SceneManager
  78.  
  79. #----------------------------------------------------------------------------
  80. # ● overwrite method: snapshot_for_background
  81. #----------------------------------------------------------------------------  
  82.   def self.snapshot_for_background
  83.     @background_bitmap.dispose if @background_bitmap
  84.     @background_bitmap = Graphics.snap_to_bitmap
  85.     if !Nio::Blur_Killer::System[:kill_blur]
  86.       @background_bitmap.blur
  87.     end
  88.   end
  89. end
  90. #===============================================================================
  91. # => END : SceneManager
  92. #===============================================================================
  93.  
  94. #==============================================================================
  95. # ■ Scene_MenuBase
  96. #------------------------------------------------------------------------------
  97. #  This class performs basic processing related to the menu screen.
  98. #==============================================================================
  99. class Scene_MenuBase < Scene_Base
  100.   include Nio::Blur_Killer
  101.  
  102. #----------------------------------------------------------------------------
  103. # ● overwrite method: create_background
  104. #----------------------------------------------------------------------------  
  105.     def create_background
  106.       case System[:background_type]
  107.       when :default
  108.         bitmap = SceneManager.background_bitmap
  109.       when :custom
  110.         bitmap = Cache.system(System[:bitmap])
  111.       end
  112.     @background_sprite = Sprite.new
  113.     @background_sprite.bitmap = bitmap
  114.     if System[:enable_color_set]
  115.       red   = System[:set_color][0]
  116.       green = System[:set_color][1]
  117.       blue  = System[:set_color][2]
  118.       alpha = System[:set_color][3]
  119.       @background_bitmap.color.set(red,green,blue,alpha)
  120.     end
  121.   end
  122. end
  123. #===============================================================================
  124. # => END : Scene_MenuBase
  125. #===============================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement