Advertisement
diamondandplatinum3

Play Game Whilst Displaying a Window ~ RGSS3

Jul 22nd, 2012
2,105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 3.63 KB | None | 0 0
  1. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  2. #   Play Game Whilst Displaying a Window
  3. #   Version: 1.0
  4. #   Author: DiamondandPlatinum3
  5. #   Date: 29/06/2012
  6. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  7. #   Description:
  8. #     This Script will allow you to display a window
  9. #     with text, but will also allow the player
  10. #     to move.
  11. #
  12. #     Useful for instructions, or to remind the player
  13. #     about their current quest objectives.
  14. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  15. #------------------------------------------------------------------------------
  16. #  Instructions:
  17. #  
  18. #     - Place this script in the materials section, above Main.
  19. #
  20. #     - In a script call event, paste the following:
  21. #      
  22. #              Message_Window_Options::Window_Text[0] =
  23. #              " "
  24. #
  25. #              Message_Window_Options::Window_Text[1] =
  26. #              " "
  27. #
  28. #              Message_Window_Options::Window_Text[2] =
  29. #              " "
  30. #
  31. #              Message_Window_Options::Window_Text[3] =
  32. #              " "
  33. #
  34. #
  35. #     - Inside those quotation marks, you insert your line of text
  36. #       for the window.
  37. #       If you have no text to put on any one line, then just leave
  38. #       a space in the quotation marks.
  39. #
  40. #
  41. #
  42. #     - You can also edit the location and size of the window itself.
  43. #       You do not have to do this, but if you wish to make your displayed
  44. #       windows to look somewhat more dynamic rather than just the same
  45. #       over and over again, you can do this.
  46. #      
  47. #            Message_Window_Options::Window_Xpos = ?
  48. #
  49. #            Message_Window_Options::Window_Ypos = ?
  50. #
  51. #            Message_Window_Options::Window_Width = ?
  52. #
  53. #            Message_Window_Options::Window_Height = ?
  54. #
  55. #            Message_Window_Options::Window_Opacity = ?
  56. #
  57. #
  58. #       The ? is where you would need to insert a number.
  59. #       They all mean exactly what they say, so Window_Width is the width of the
  60. #       Window and Window_Opacity is the Opacity of the Window.
  61. #
  62. #
  63. #     - If you choose not to define your options before calling the window,
  64. #       either the default values will be used or your previously inserted
  65. #       values will be reused.
  66. #
  67. #
  68. #     - Once you have inserted your text and options (if you chose to do so),
  69. #       You now call the window with:
  70. #
  71. #           @Message_Window = Message_Window.new
  72. #
  73. #
  74. #    - When you're finished with the window being displayed, you use this script
  75. #      call to get rid of it:
  76. #
  77. #           @Message_Window.dispose
  78. #
  79. #
  80. #==============================================================================
  81. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  82. module Message_Window_Options
  83. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  84.   Window_Xpos       = 0
  85.   Window_Ypos       = 0
  86.   Window_Width      = 544
  87.   Window_Height     = 128
  88.   Window_Text       = ["Line1","Line2","Line3","Line4"]
  89.   Window_Opacity    = 100
  90. #=========------------============---------==--=
  91. end # of module
  92. #--------=============------------==========--=-
  93.  
  94.  
  95. class Message_Window < Window_Base
  96.   def initialize
  97.     super(Message_Window_Options::Window_Xpos,Message_Window_Options::Window_Ypos,Message_Window_Options::Window_Width,Message_Window_Options::Window_Height)
  98.    
  99.     @WLH = line_height
  100.    
  101.     self.opacity = Message_Window_Options::Window_Opacity
  102.    
  103.     for i in 0..Message_Window_Options::Window_Text.size
  104.       self.contents.draw_text(0, @WLH*i, Message_Window_Options::Window_Width, @WLH, Message_Window_Options::Window_Text[i], 0)
  105.     end
  106.   end
  107. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement