Advertisement
Zetu

Jet Credits EDIT

Jun 26th, 2011
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 3.74 KB | None | 0 0
  1. #===============================================================================
  2. # Credits               -    Image Edit
  3. # By Jet10985 (Jet)     -    By Zetu
  4. #===============================================================================
  5. # This script will allows you to have a scene with a list of credits rolling
  6. # from the bottom of the screen up.
  7. # This script has: 4 customization options.
  8. #===============================================================================
  9. # Overwritten Methods:
  10. # None
  11. #-------------------------------------------------------------------------------
  12. # Aliased methods:
  13. # None
  14. #===============================================================================
  15. =begin
  16. To call credits:
  17.  
  18. Use the following in an event's Script... command
  19.  
  20. $scene = Scene_Credits.new(return_scene)
  21.  
  22. return_scene = The name of the scene the credits will go to after rolling.
  23. this should be in quotes, like:
  24.  
  25. $scene = Scene_Credits.new("Scene_Title") would go to the title screen
  26. or
  27. $scene = Scene_Credits.new("Scene_Map") would go to the map
  28.  
  29. you don't HAVE to include return_scene at all, like so:
  30.  
  31. $scene = Scene_Credits.new
  32.  
  33. this would go to the title screen after finishing.
  34.  
  35. =end
  36.  
  37. module JetCredits
  38.  
  39.   # This is the text that will be displayed for the credits rolling.
  40.   # Stay within the { and the }
  41.   CREDITS_TEXT = %Q{
  42.  
  43. Credits
  44.                
  45. Scripts -
  46. _________
  47.            
  48. Jet - Credit Script
  49.            
  50. Others -
  51. ________
  52.            
  53. Jet - Being cools and everything yo
  54.            
  55. AND FINALLY, THE ONE, THE ONLY
  56.      
  57. Jet - he is just too hawt not to credit
  58.      
  59.   }
  60.  
  61.   # Do you want to center the text in the screen?
  62.   CENTER_CREDITS_TEXT = true
  63.  
  64.   # Are the credits skippable with a button?
  65.   SKIP_CREDITS_WITH_BUTTON = true
  66.  
  67.   # This is the button then can press if they want to skip the credits.
  68.   SKIP_CREDITS_BUTTON = Input::C
  69.  
  70. end
  71.  
  72. module Z # For Edits made by Zetu
  73.   module Cred
  74.    
  75.     IMAGES = [
  76.       #[Name, x, y] Remeber, y = (line number - 1) * 24
  77.       ["imagename", 288, 48]
  78.     ] # DO NOT REMOVE!
  79.    
  80.    
  81.     def self.draw_pic(filename, x, y)
  82.       bitmap = Cache.picture(filename)
  83.       rect = Rect.new(0, 0, 0, 0)
  84.       rect.width = bitmap.width
  85.       rect.height = bitmap.height
  86.       self.contents.blt(x, y, bitmap, rect)
  87.       bitmap.dispose
  88.     end
  89.   end
  90.  
  91. end
  92.  
  93. #===============================================================================
  94. # DON'T EDIT FURTHER UNLESS YOU KNOW WHAT TO DO.
  95. #==============================================================================
  96. class Scene_Credits < Scene_Base
  97.  
  98.   include JetCredits
  99.  
  100.   def initialize(return_scene = "Scene_Title")
  101.     @return_scene = return_scene
  102.   end
  103.  
  104.   def start
  105.     create_menu_background
  106.     @text = CREDITS_TEXT
  107.     q = CENTER_CREDITS_TEXT ? 1 : 0
  108.     line_index = 0
  109.     @text.each_line {|s|
  110.       line_index += 1
  111.     }
  112.     @credits = Window_Base.new(0, 416, 544, line_index * 24 + 32)
  113.     @credits.opacity = 0
  114.     line_index = 0
  115.     @text.each_line {|s|
  116.       text_to_draw = s.gsub("\n"){|h| "" }
  117.       @credits.contents.draw_text(0, line_index * 24, 514, 24, text_to_draw, q)
  118.       line_index += 1
  119.     }
  120.     for image in Z::CRED::IMAGES
  121.       filename, x, y = image
  122.       Z::CRED::draw_pic(filename, x, y)
  123.     end
  124.   end
  125.  
  126.   def update
  127.     super
  128.     loop do
  129.       Graphics.update
  130.       Input.update
  131.       @credits.y -= 1
  132.       if SKIP_CREDITS_WITH_BUTTON
  133.         if Input.trigger?(SKIP_CREDITS_BUTTON)
  134.           break
  135.         end
  136.       end
  137.       break if @credits.y <= @credits.height * -1
  138.     end
  139.     eval("$scene = #{@return_scene}.new")
  140.   end
  141.  
  142.   def terminate
  143.     super
  144.     dispose_menu_background
  145.     @credits.dispose
  146.   end
  147. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement