Advertisement
Archeia

Untitled

Nov 17th, 2015
608
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 1.83 KB | None | 0 0
  1. #==============================================================================
  2. # ■ Window Identifier (WINDOW_IDENTIFIER) by rhyme
  3. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  4. # Shows the name of the windows depending on the present class while holding
  5. # CTRL. Make sure to disable this on your game's final release!
  6. #==============================================================================
  7.  
  8. class Window_Base < Window
  9.   #--------------------------------------------------------------------------
  10.   # * Create Window Contents
  11.   #--------------------------------------------------------------------------
  12.   alias create_contents_rhy create_contents
  13.   def create_contents
  14.     create_contents_rhy
  15.     if @windowname
  16.       @windowname.bitmap.dispose
  17.       @windowname.dispose
  18.       @windowname = nil
  19.     end
  20.     @windowname = Sprite.new(self.viewport)
  21.     @windowname.bitmap = Bitmap.new(500, line_height)
  22.     @windowname.bitmap.draw_text(0, 0, 500, 24, self.class.to_s, 0)
  23.     @windowname.opacity = 0
  24.   end
  25.   #--------------------------------------------------------------------------
  26.   # * Frame Update
  27.   #--------------------------------------------------------------------------
  28.   alias update_rhy update
  29.   def update
  30.     update_rhy
  31.     @windowname.x = self.x
  32.     @windowname.y = self.y
  33.     @windowname.z = self.z + 1
  34.     if Input.press?(:CTRL)
  35.       @windowname.opacity += 16
  36.     else
  37.       @windowname.opacity -= 16
  38.     end
  39.   end
  40.   #--------------------------------------------------------------------------
  41.   # * Dispose
  42.   #--------------------------------------------------------------------------
  43.   alias dispose_rhy dispose
  44.   def dispose
  45.     if @windowname
  46.       @windowname.bitmap.dispose
  47.       @windowname.dispose
  48.       @windowname = nil
  49.     end
  50.     dispose_rhy
  51.   end  
  52. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement