pigu_6

Jet & Zerbu| Kingdom Hearts title menu

Nov 23rd, 2012
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.42 KB | None | 0 0
  1.  
  2. #===============================================================================
  3. # Options
  4. #===============================================================================
  5. module Options
  6. #===============================================================================
  7. #Jet's Splash Config
  8. #===============================================================================
  9. # These are the pictures that will be cycled through in the splash scene
  10. SPLASH_PICTURES = ["Logo"]
  11.  
  12. # These are SE that will be played for each picture. The SE will play
  13. # with the same picture that shares the index.
  14. # If you don't want an SE to play with a picture, fill the index with ""
  15. SPLASH_SOUNDS = ["Heal2"]
  16.  
  17. # Do you want to skip the splash scene in testing mode?
  18. SPLASH_DISABLED_IN_DEBUG = true
  19.  
  20. # Do you want the splash screen skippable in the actual game as well?
  21. SPLASH_SKIPPABLE = true
  22.  
  23. # If SPLASH_SKIPPABLE is true, what button should be pressed to skip it?
  24. # Note: Input::C is the enter button
  25. SPLASH_SKIP_BUTTON = Input::C
  26.  
  27. # Harder Config (For those who know how to configure well)
  28. #==========================================================================
  29.  
  30. # Enabling this ignore the SPLASH_PICTURES and SPLASH_SOUNDS config above
  31. ENABLE_HARDER_CONFIG = true
  32.  
  33. # This is the config for a cooler looking splash scene.
  34. # It follows this format:
  35. # picture_name => [se_name, anim_id, fadein_time, fadeout_time, frame_time]
  36. # se_name is the SE to be played with the picture. Use "" for no SE
  37. # anim_id is the animation to be played ontop of the picture. Use 0 for none
  38. # fadein_time is how many frames it takes to fade into the picture
  39. # fadeout_time is how many frames it takes to fadeout to the next picture
  40. # frame_time is how long the picture stays on the screen before fading out
  41. SUPER_SPLASH = {
  42.  
  43. "Logo" => ["Heal2", 0, 60, 60, 180]
  44.  
  45. }
  46. # End Jet's Splash Config
  47. #===============================================================================
  48.  
  49. #===============================================================================
  50. # Zerbu's Title Options
  51. #===============================================================================
  52.  
  53. ZE_TSWO = {
  54. #------------------------------------------------------------------------
  55. # What font should be used on the title screen?
  56. #------------------------------------------------------------------------
  57. :FONT_FACE => ["VL Gothic", "Verdana", "Arial", "Courier"],
  58. #------------------------------------------------------------------------
  59. # What size should the text be?
  60. #------------------------------------------------------------------------
  61. :FONT_SIZE => 24,
  62. #------------------------------------------------------------------------
  63. # Should the text on the title screen be bold?
  64. #------------------------------------------------------------------------
  65. :FONT_BOLD => false,
  66. #------------------------------------------------------------------------
  67. # Should the text on the title screen be italic?
  68. #------------------------------------------------------------------------
  69. :FONT_ITALIC => false,
  70. #------------------------------------------------------------------------
  71. # Should the text on the title screen have a shadow?
  72. #------------------------------------------------------------------------
  73. :FONT_SHADOW => false,
  74. #------------------------------------------------------------------------
  75. # Should the text on the title screen have an outline?
  76. #------------------------------------------------------------------------
  77. :FONT_OUTLINE => true,
  78. #------------------------------------------------------------------------
  79. # What colour should the outline be? The format to use is:
  80. # [red, green, blue, opacity]
  81. #------------------------------------------------------------------------
  82. :FONT_OUT_COL => [0, 0, 0],
  83. #------------------------------------------------------------------------
  84. # This is the Windowskin used on the title screen.
  85. #------------------------------------------------------------------------
  86. :WINDOWSKIN => "TitleWindow",
  87. #------------------------------------------------------------------------
  88. # This is the width of the title window. If this is set to 0, the
  89. # default width will be used.
  90. #------------------------------------------------------------------------
  91. :WINDOW_WIDTH => 500,
  92. #------------------------------------------------------------------------
  93. # This is the X position of the title window. If this is set to -1, the
  94. # default position will be used.
  95. #------------------------------------------------------------------------
  96. :WINDOW_X => 20,
  97. #------------------------------------------------------------------------
  98. # This is the Y position of the title window. If this is set to -1, the
  99. # default position will be used.
  100. #------------------------------------------------------------------------
  101. :WINDOW_Y => 275,
  102. #------------------------------------------------------------------------
  103. # This is the opacity of the window.
  104. #------------------------------------------------------------------------
  105. :OPACITY => 0,
  106. #------------------------------------------------------------------------
  107. # This is the back opacity of the window.
  108. #------------------------------------------------------------------------
  109. :BACK_OPACITY => 200,
  110. #------------------------------------------------------------------------
  111. #This is the background picture.
  112. #------------------------------------------------------------------------
  113. :BACK_PIC => "Plane1"
  114. }
  115.  
  116. # End Zerbu's Title Options
  117. #===============================================================================
  118.  
  119. end
  120. #===============================================================================
  121. # Jet's Splash Screen
  122. #===============================================================================
  123.  
  124. class Scene_Title < Scene_Base
  125.  
  126. include Options
  127.  
  128. def start
  129. if ENABLE_HARDER_CONFIG
  130. do_super_splash
  131. else
  132. create_sprites
  133. create_sounds
  134. do_splash
  135. end
  136. end
  137.  
  138. def terminate
  139. return if @sprites.nil?
  140. for sprite in @sprites
  141. sprite.dispose
  142. sprite = nil
  143. end
  144. end
  145.  
  146. def create_sprites
  147. @sprites = []
  148. for pic in SPLASH_PICTURES
  149. f = Cache.picture(pic)
  150. g = Sprite_Base.new
  151. g.bitmap = f
  152. g.visible = false
  153. @sprites << g
  154. end
  155. end
  156.  
  157. def create_sounds
  158. @sounds = []
  159. for sound in SPLASH_SOUNDS
  160. @sounds << RPG::SE.new(sound, 80, 100)
  161. end
  162. end
  163.  
  164. def do_splash
  165. Graphics.transition
  166. Graphics.fadeout(60)
  167. for sprite in @sprites
  168. sprite.visible = true
  169. Graphics.fadein(60)
  170. begin
  171. @sounds[@sprites.index(sprite)].play
  172. rescue
  173. end
  174. 180.times do
  175. Input.update if SPLASH_SKIPPABLE
  176. if Input.trigger?(SPLASH_SKIP_BUTTON)
  177. $scene = Scene_Title2.new
  178. break
  179. end
  180. Graphics.wait(1)
  181. end
  182. Graphics.fadeout(60)
  183. sprite.visible = false
  184. end
  185. $jet6667876666765 = true
  186. SceneManager.call(Scene_Title2)
  187. end
  188.  
  189. def do_super_splash
  190. Graphics.transition
  191. Graphics.fadeout(1)
  192. for sprite in SUPER_SPLASH.keys
  193. q = Sprite_Base.new
  194. q.bitmap = Cache.picture(sprite)
  195. Graphics.fadein(SUPER_SPLASH[sprite][2])
  196. begin
  197. RPG::SE.new(SUPER_SPLASH[sprite][0], 80, 100).play
  198. rescue
  199. end
  200. anim = load_data("Data/Animations.rvdata2")[SUPER_SPLASH[sprite][1]]
  201. if SUPER_SPLASH[sprite][1] != 0
  202. q.start_animation(anim)
  203. end
  204. SUPER_SPLASH[sprite][4].times do
  205. Input.update if SPLASH_SKIPPABLE
  206. if Input.trigger?(SPLASH_SKIP_BUTTON)
  207. $scene = Scene_Title2.new
  208. break
  209. end
  210. q.update
  211. Graphics.update
  212. end
  213. Graphics.fadeout(SUPER_SPLASH[sprite][3])
  214. end
  215. $jet6667876666765 = true
  216. SceneManager.call(Scene_Title2)
  217. end
  218. end
  219. #==============================================================================
  220. # �–� Scene_Title
  221. #------------------------------------------------------------------------------
  222. # �€€�‚��‚��ƒˆ�ƒ��”�面の�‡���†�‚’��Œ��†�‚��ƒ��‚�で��™�€‚
  223. #==============================================================================
  224.  
  225. class Scene_Title2 < Scene_Base
  226. include Options
  227.  
  228. #--------------------------------------------------------------------------
  229. # �—� �–‹��‹�‡���†
  230. #--------------------------------------------------------------------------
  231. def start
  232. super
  233. SceneManager.clear
  234. Graphics.freeze
  235. create_background
  236. create_foreground
  237. create_command_window
  238. play_title_music
  239. end
  240. #--------------------------------------------------------------------------
  241. # �—� �ƒˆ�ƒ��ƒ��‚��‚��ƒ��ƒ��€Ÿ度の��–��—
  242. #--------------------------------------------------------------------------
  243. def transition_speed
  244. return 20
  245. end
  246. #--------------------------------------------------------------------------
  247. # �—� ��‚��†�‡���†
  248. #--------------------------------------------------------------------------
  249. def terminate
  250. super
  251. SceneManager.snapshot_for_background
  252. dispose_background
  253. dispose_foreground
  254. end
  255. #--------------------------------------------------------------------------
  256. # �—� �ƒŒ�™�の��œ�ˆ�
  257. #--------------------------------------------------------------------------
  258. def create_background
  259. @sprite1 = Sprite.new
  260. @sprite1.bitmap = Cache.picture(ZE_TSWO[:BACK_PIC])
  261. center_sprite(@sprite1)
  262. end
  263. #--------------------------------------------------------------------------
  264. # �—� �‰��™�の��œ�ˆ�
  265. #--------------------------------------------------------------------------
  266. def create_foreground
  267. @foreground_sprite = Sprite.new
  268. @foreground_sprite.bitmap = Bitmap.new(Graphics.width, Graphics.height)
  269. @foreground_sprite.z = 100
  270. end
  271. #--------------------------------------------------------------------------
  272. # �—� �ƒŒ�™�の解�”�
  273. #--------------------------------------------------------------------------
  274. def dispose_background
  275. @sprite1.bitmap.dispose
  276. @sprite1.dispose
  277. end
  278. #--------------------------------------------------------------------------
  279. # �—� �‰��™�の解�”�
  280. #--------------------------------------------------------------------------
  281. def dispose_foreground
  282. @foreground_sprite.bitmap.dispose
  283. @foreground_sprite.dispose
  284. end
  285. #--------------------------------------------------------------------------
  286. # �—� �‚��ƒ—�ƒ��‚��ƒˆ�‚’�”�面中央に移�‹•
  287. #--------------------------------------------------------------------------
  288. def center_sprite(sprite)
  289. sprite.ox = sprite.bitmap.width / 2
  290. sprite.oy = sprite.bitmap.height / 2
  291. sprite.x = Graphics.width / 2
  292. sprite.y = Graphics.height / 2
  293. end
  294. #--------------------------------------------------------------------------
  295. # �—� �‚��ƒž�ƒ��ƒ‰�‚��‚��ƒ��ƒ‰�‚�の��œ�ˆ�
  296. #--------------------------------------------------------------------------
  297. def create_command_window
  298. @command_window = Window_TitleCommand.new
  299. @command_window.set_handler(:new_game, method(:command_new_game))
  300. @command_window.set_handler(:continue, method(:command_continue))
  301. @command_window.set_handler(:shutdown, method(:command_shutdown))
  302. end
  303. #--------------------------------------------------------------------------
  304. # �—� �‚��ƒž�ƒ��ƒ‰�‚��‚��ƒ��ƒ‰�‚��‚’�–‰��˜�‚‹
  305. #--------------------------------------------------------------------------
  306. def close_command_window
  307. @command_window.close
  308. update until @command_window.close?
  309. end
  310. #--------------------------------------------------------------------------
  311. # �—� �‚��ƒž�ƒ��ƒ‰[�ƒ‹�ƒ��ƒ��‚��ƒ��ƒ�]
  312. #--------------------------------------------------------------------------
  313. def command_new_game
  314. DataManager.setup_new_game
  315. close_command_window
  316. fadeout_all
  317. $game_map.autoplay
  318. SceneManager.goto(Scene_Map)
  319. end
  320. #--------------------------------------------------------------------------
  321. # �—� �‚��ƒž�ƒ��ƒ‰[�‚��ƒ��ƒ†�‚��ƒ‹�ƒ��ƒ�]
  322. #--------------------------------------------------------------------------
  323. def command_continue
  324. close_command_window
  325. SceneManager.call(Scene_Load)
  326. end
  327. #--------------------------------------------------------------------------
  328. # �—� �‚��ƒž�ƒ��ƒ‰[�‚��ƒ��ƒƒ�ƒˆ�ƒ€�‚��ƒ�]
  329. #--------------------------------------------------------------------------
  330. def command_shutdown
  331. close_command_window
  332. fadeout_all
  333. SceneManager.exit
  334. end
  335. #--------------------------------------------------------------------------
  336. # �—� �‚��‚��ƒˆ�ƒ��”�面の�Ÿ�楽��”奏
  337. #--------------------------------------------------------------------------
  338. def play_title_music
  339. $data_system.title_bgm.play
  340. RPG::BGS.stop
  341. RPG::ME.stop
  342. end
  343. end
  344. #============================================================================
  345. # Zerbu Engine - Title Screen Window Options
  346. #----------------------------------------------------------------------------
  347. # This script allows you to set window options specifically for the title
  348. # screen to customize its appearance.
  349. #============================================================================
  350.  
  351.  
  352.  
  353. #============================================================================
  354. # Window_TitleCommand
  355. #============================================================================
  356. class Window_TitleCommand < Window_Command
  357. include Options
  358.  
  359. #--------------------------------------------------------------------------
  360. # alias method: initialize
  361. #--------------------------------------------------------------------------
  362. alias ze_tsto_initialize initialize
  363. def initialize
  364. #---
  365. ze_tsto_initialize
  366. #---
  367. self.windowskin = Cache.system(ZE_TSWO[:WINDOWSKIN])
  368. self.opacity = ZE_TSWO[:OPACITY]
  369. self.back_opacity = ZE_TSWO[:BACK_OPACITY]
  370. #---
  371. end
  372.  
  373. #--------------------------------------------------------------------------
  374. # alias method: window_width
  375. #--------------------------------------------------------------------------
  376. alias ze_tswo_window_width window_width
  377. def window_width
  378. #---
  379. if ZE_TSWO[:WINDOW_WIDTH] != 0
  380. return ZE_TSWO[:WINDOW_WIDTH]
  381. else
  382. ze_tswo_window_width
  383. end
  384. #---
  385. end
  386.  
  387. #--------------------------------------------------------------------------
  388. # alias method: draw_item
  389. #--------------------------------------------------------------------------
  390. alias ze_tswo_draw_item draw_item
  391. def draw_item(index)
  392. #---
  393. contents.font.name = ZE_TSWO[:FONT_FACE]
  394. contents.font.size = ZE_TSWO[:FONT_SIZE]
  395. contents.font.bold = ZE_TSWO[:FONT_BOLD]
  396. contents.font.italic = ZE_TSWO[:FONT_ITALIC]
  397. contents.font.shadow = ZE_TSWO[:FONT_SHADOW]
  398. contents.font.outline = ZE_TSWO[:FONT_OUTLINE]
  399. contents.font.out_color = Color.new(ZE_TSWO[:FONT_OUT_COL][0], ZE_TSWO[:FONT_OUT_COL][1], ZE_TSWO[:FONT_OUT_COL][2])
  400. #---
  401. ze_tswo_draw_item(index)
  402. #---
  403. end
  404.  
  405. #--------------------------------------------------------------------------
  406. # overwrite method: update_placement
  407. #--------------------------------------------------------------------------
  408. def update_placement
  409. #---
  410. if ZE_TSWO[:WINDOW_X] != -1
  411. self.x = ZE_TSWO[:WINDOW_X]
  412. else
  413. self.x = (Graphics.width - width) / 2
  414. end
  415. #---
  416. if ZE_TSWO[:WINDOW_Y] != -1
  417. self.y = ZE_TSWO[:WINDOW_Y]
  418. else
  419. self.y = (Graphics.height * 1.6 - height) / 2
  420. end
  421. #---
  422. end
  423. end
Advertisement
Add Comment
Please, Sign In to add comment