Advertisement
AngryPacman

PAC Centered Window

Jul 29th, 2011
254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 1.92 KB | None | 0 0
  1. #===============================================================================
  2. #
  3. # Pacman Advanced Creative (PAC) Engine - Centered Window
  4. # 25/4/2011
  5. # Type: Main
  6. # Installation: Plug-and-play.
  7. # Level: Super-Simple
  8. # Paste above main, save the editor.
  9. #
  10. #===============================================================================
  11. #
  12. # WHAT THE HELL IS THIS???
  13. # This is a tool for scripters. It is a centered window that I have graciously
  14. # made for you to use. To use this properly, instead of calling a Window_Command
  15. # or have a class inherit from Window_Command, call Window_Command_Centered.
  16. # It is a very simple edit, just something that bugged me a little. Use it.
  17. # It's good for you.
  18. #
  19. #===============================================================================
  20.  
  21. $imported = {} if $imported == nil
  22. $imported["PAC_CenteredWindow"] = true
  23.  
  24. #==============================================================================
  25. # ** Window_Command_Centered
  26. #------------------------------------------------------------------------------
  27. # This window displays the command window, but better.
  28. #==============================================================================
  29.  
  30. class Window_Command_Centered < Window_Command
  31.   #--------------------------------------------------------------------------
  32.   # * Draw Item
  33.   #--------------------------------------------------------------------------
  34.   def draw_item(index, enabled = true)
  35.     rect = item_rect(index)
  36.     rect.x += 4
  37.     rect.width -= 8
  38.     self.contents.clear_rect(rect)
  39.     self.contents.font.color = normal_color
  40.     self.contents.font.color.alpha = enabled ? 255 : 128
  41.     self.contents.draw_text(rect, @commands[index],1) # Draw the text aligned.
  42.   end
  43. end
  44.  
  45. #===============================================================================
  46. #
  47. # END OF SCRIPT
  48. #
  49. #===============================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement