Advertisement
roninator2

Kid Friendly Basic Quest - Map Name Position

Dec 14th, 2024
18
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 4.28 KB | None | 0 0
  1. # ╔═════════════════════════════════════╦════════════════════╗
  2. # ║ Title: KFBQ Map Name Position       ║  Version: 1.00     ║
  3. # ║ Author: Roninator2                  ║                    ║
  4. # ╠═════════════════════════════════════╬════════════════════╣
  5. # ║ Function:                           ║   Date Created     ║
  6. # ║                                     ╠════════════════════╣
  7. # ║   FFMQ Style Map Name Shown         ║    09 Mar 2023     ║
  8. # ╚═════════════════════════════════════╩════════════════════╝
  9. # ╔══════════════════════════════════════════════════════════╗
  10. # ║ Instructions:                                            ║
  11. # ║                                                          ║
  12. # ║  Script sets the position and display of the Map Name    ║
  13. # ║  on the screen.                                          ║
  14. # ╚══════════════════════════════════════════════════════════╝
  15. # ╔══════════════════════════════════════════════════════════╗
  16. # ║ Terms of use:                                            ║
  17. # ║ Free for all uses in RPG Maker - Except nudity           ║
  18. # ╚══════════════════════════════════════════════════════════╝
  19.  
  20. #==============================================================================
  21. # ** Window Map NAme
  22. #==============================================================================
  23. class Window_MapName < Window_Base
  24.   #--------------------------------------------------------------------------
  25.   # * Initialize
  26.   #--------------------------------------------------------------------------
  27.   def initialize
  28.     x = (Graphics.width - window_width) / 2
  29.     y = Graphics.height - 150
  30.     super(x, y, window_width, fitting_height(1))
  31.         self.opacity, self.contents_opacity, @show_count = 0, 0, 0
  32.     refresh
  33.   end
  34.   #--------------------------------------------------------------------------
  35.   # * Update Fadein
  36.   #--------------------------------------------------------------------------
  37.     def update_fadein
  38.         self.opacity += 32 unless $game_map.display_name.empty?
  39.         self.contents_opacity += 16
  40.     end
  41.   #--------------------------------------------------------------------------
  42.   # * Update Fadeout
  43.   #--------------------------------------------------------------------------
  44.     def update_fadeout
  45.         self.opacity -= 16 unless $game_map.display_name.empty?
  46.         self.contents_opacity -= 16
  47.     end
  48.   #--------------------------------------------------------------------------
  49.   # * Refresh
  50.   #--------------------------------------------------------------------------
  51.     def refresh
  52.         contents.clear
  53.         return if $game_map.display_name.empty?
  54.         draw_text(contents.rect, $game_map.display_name, 1)
  55.     end
  56. end
  57.  
  58. #==============================================================================
  59. # ** Scene_Map
  60. #==============================================================================
  61. class Scene_Map < Scene_Base
  62.   #--------------------------------------------------------------------------
  63.   # * Start
  64.   #--------------------------------------------------------------------------
  65.   alias r2_map_start_name start
  66.   def start
  67.     r2_map_start_name
  68.     display_name
  69.   end
  70.   #--------------------------------------------------------------------------
  71.   # * Display Name
  72.   #--------------------------------------------------------------------------
  73.   def display_name
  74.     return if @shown_name == true
  75.     @map_name_window.open
  76.     @shown_name = true
  77.   end
  78. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement