Advertisement
Dekita

Scene BGs 1.1

Apr 2nd, 2013
823
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.59 KB | None | 0 0
  1. if true # << Make true to use this script, false to disable.
  2. #===============================================================================
  3. #
  4. # ☆ $D13x - Scene Backgrounds
  5. # -- Author : Dekita
  6. # -- Version : 1.1
  7. # -- Level : Easy / Normal
  8. # -- Requires : N/A
  9. # -- Engine : RPG Maker VX Ace.
  10. #
  11. #===============================================================================
  12. # ☆ Import
  13. #-------------------------------------------------------------------------------
  14. $D13x={}if$D13x==nil
  15. $D13x[:Scene_BGs]=true
  16. #===============================================================================
  17. # ☆ Updates
  18. #-------------------------------------------------------------------------------
  19. # D /M /Y
  20. # o1/o4/2o13 - Compatibility, ($D13x Title)
  21. # 26/o3/2o13 - Started, Finished,
  22. #
  23. #===============================================================================
  24. # ☆ Introduction
  25. #-------------------------------------------------------------------------------
  26. # This script allows unlimited graphics/parallaxx's to be displayed on almost
  27. # EVERY default scene, such as the Scene_Status or Scene_Equip, Scene_Load ect..
  28. # You can also scroll each image like a parallaxx, change the hue of each image,
  29. # set the inital position for each image, the importance and even how long
  30. # it takes for each graphic to reach full visibility :)
  31. #
  32. # NOTE: This DOES NOT !! modify Scene_Title, the reason for this is simple,
  33. # There are other title screen scripts that offer more control over command
  34. # graphics and such(including my own $D13x Title Screen).
  35. #
  36. #===============================================================================
  37. # ★☆★☆★☆★☆★☆★☆★☆★ TERMS AND CONDITIONS: ☆★☆★☆★☆★☆★☆★☆★☆★☆
  38. #===============================================================================
  39. # 1. You MUST give credit to "Dekita" !!
  40. # 2. You are NOT allowed to repost this script.(or modified versions)
  41. # 3. You are NOT allowed to convert this script.
  42. # 4. You are NOT allowed to use this script for Commercial games.
  43. # 5. ENJOY!
  44. #
  45. # "FINE PRINT"
  46. # By using this script you hereby agree to the above terms and conditions,
  47. # if any violation of the above terms occurs "legal action" may be taken.
  48. # Not understanding the above terms and conditions does NOT mean that
  49. # they do not apply to you.
  50. # If you wish to discuss the terms and conditions in further detail you can
  51. # contact me at http://dekitarpg.wordpress.com/
  52. #
  53. #===============================================================================
  54. # ☆ Instructions
  55. #-------------------------------------------------------------------------------
  56. # Place Below " ▼ Materials " and Above " ▼ Main " in your script editor.
  57. #
  58. #===============================================================================
  59. # ☆ HELP
  60. #-------------------------------------------------------------------------------
  61. # Remember to put your graphics into the new folder (defined below)
  62. #
  63. #===============================================================================
  64. module Scene_Backgrounds
  65. #===============================================================================
  66. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  67. # ☆ General Settings
  68. #-----------------------------------------------------------------------------
  69. # This is where you set the folder, that Graphics should be palced in.
  70. Folder = "Graphics/$D13x/BGs/"
  71. # Scene Transition speed.
  72. Transition_Speed = 20
  73. #-----------------------------------------------------------------------------
  74. BGs={:default=>nil,# << KEEP
  75. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  76. # ☆ Background Settings
  77. #-----------------------------------------------------------------------------
  78. # This is how you add an image into a scene...
  79. # :scene =>[ << Always needed.
  80. # ['NAME' , x, y, x scroll, y scroll, z, hue, init opac, max opac],
  81. # ], # << Always needed.
  82. #-----------------------------------------------------------------------------
  83. # ['NAME' , x, y, x scroll, y scroll, z, hue, init opac, max opac],
  84. :scene_menu =>[
  85. ['Sunbeam_Overlay_by ShinGamix',0,0, 0, 0, 1, 0, 105, 155],
  86. ['ShinGamox_by ShinGamix',0,0, 0, 0, 1, 0, 105, 145],
  87. ],# << end
  88. #-----------------------------------------------------------------------------
  89. # ['NAME' , x, y, x scroll, y scroll, z, hue, init opac, max opac],
  90. :scene_item =>[
  91. ['Sunbeam_Overlay_by ShinGamix',0,0, 0, 0, 1, 0, 105, 155],
  92. ['ShinGamox_by ShinGamix',0,0, 0, 0, 1, 0, 105, 145],
  93. ],# << end
  94. #-----------------------------------------------------------------------------
  95. # ['NAME' , x, y, x scroll, y scroll, z, hue, init opac, max opac],
  96. :scene_skill =>[
  97. ['Sunbeam_Overlay_by ShinGamix',0,0, 0, 0, 1, 0, 105, 155],
  98. ['ShinGamox_by ShinGamix',0,0, 0, 0, 1, 0, 105, 145],
  99. ],# << end
  100. #-----------------------------------------------------------------------------
  101. # ['NAME' , x, y, x scroll, y scroll, z, hue, init opac, max opac],
  102. :scene_equip =>[
  103. ['Sunbeam_Overlay_by ShinGamix',0,0, 0, 0, 1, 0, 105, 155],
  104. ['ShinGamox_by ShinGamix',0,0, 0, 0, 1, 0, 105, 145],
  105. ],# << end
  106. #-----------------------------------------------------------------------------
  107. # ['NAME' , x, y, x scroll, y scroll, z, hue, init opac, max opac],
  108. :scene_status =>[
  109. ['Sunbeam_Overlay_by ShinGamix',0,0, 0, 0, 1, 0, 105, 155],
  110. ['ShinGamox_by ShinGamix',0,0, 0, 0, 1, 0, 105, 145],
  111. ],# << end
  112. #-----------------------------------------------------------------------------
  113. # ['NAME' , x, y, x scroll, y scroll, z, hue, init opac, max opac],
  114. :scene_save =>[
  115. ['Sunbeam_Overlay_by ShinGamix',0,0, 0, 0, 1, 0, 105, 155],
  116. ['ShinGamox_by ShinGamix',0,0, 0, 0, 1, 0, 105, 145],
  117. ],# << end
  118. #-----------------------------------------------------------------------------
  119. # ['NAME' , x, y, x scroll, y scroll, z, hue, init opac, max opac],
  120. :scene_load =>[
  121. ['StarSky_Red' , 0, 0, 1, -1, 0, 0, 254, 255],
  122. ['Sunbeam_Overlay_by ShinGamix',0,0, 0, 0, 1, 0, 105, 155],
  123. ['ShinGamox_by ShinGamix',0,0, 0, 0, 1, 0, 105, 145],
  124. ['Fog_By_hyde' , 100, 100, 2, -2, 0, 0, 74, 75],
  125. ],# << end
  126. #-----------------------------------------------------------------------------
  127. # ['NAME' , x, y, x scroll, y scroll, z, hue, init opac, max opac],
  128. :scene_end =>[
  129. ['Sunbeam_Overlay_by ShinGamix',0,0, 0, 0,1, 0, 5, 255],
  130. ['ShinGamox_by ShinGamix',0,0, 0, 0, 1, 0, 105, 145],
  131. ['$D13x By rgangsta',0,0, 0, 0,1, 0, 105, 155],
  132. ['Fog_By_hyde' , 50, 50, 0, -1,1,180, 104, 105],
  133. ['Cloud1_By_Hyde',100,100, 1, -1, 101, 0, 104, 105],
  134. ],# << end
  135. #-----------------------------------------------------------------------------
  136. # ['NAME' , x, y, x scroll, y scroll, z, hue, init opac, max opac],
  137. :scene_shop =>[
  138. ['Fog_By_hyde' , 50, 50, 1, -2, 0, 0, 74, 75],
  139. ['Fog_By_hyde' , 100, 100, 2, -2, 0, 0, 74, 75],
  140. ],# << end
  141. #-----------------------------------------------------------------------------
  142. # ['NAME' , x, y, x scroll, y scroll, z, hue, init opac, max opac],
  143. :scene_name =>[
  144. ['Sunbeam_Overlay_by ShinGamix',0,0, 0, 0, 1, 0, 105, 155],
  145. ['ShinGamox_by ShinGamix',0,0, 0, 0, 1, 0, 105, 145],
  146. ],# << end
  147. #-----------------------------------------------------------------------------
  148. # ['NAME' , x, y, x scroll, y scroll, z, hue, init opac, max opac],
  149. :scene_gameover =>[
  150. ['SkullBlue',0,0,0,0, 1,0, 255, 255],
  151. ['Sunbeam_Overlay_by ShinGamix',0,0, 0, 0, 1, 0, 105, 155],
  152. ['ShinGamox_by ShinGamix',0,0, 0, 0, 1, 0, 105, 145],
  153. ['Cloud1_By_Hyde',100,100, 2, -2, 1, 0, 104, 105],
  154. ],# << end
  155. #-----------------------------------------------------------------------------
  156. # ['NAME' , x, y, x scroll, y scroll, z, hue, init opac, max opac],
  157. :scene_debug =>[
  158. ['StarSky_Red' , 0, 0, 1, -1, 1, 0, 254, 255],
  159. ['Fog_By_hyde' , 50, 50, 1, -2, 1, 0, 74, 75],
  160. ['Fog_By_hyde' , 100, 100, 2, -2, 1, 0, 74, 75],
  161. ],# << end
  162. #-----------------------------------------------------------------------------
  163. }# << END ALL Backgrounds, #####################
  164. # MUST Be Kept! # CUSTOMISATION END #
  165. end #####################
  166. #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★#
  167. # #
  168. # http://dekitarpg.wordpress.com/ #
  169. # #
  170. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆#
  171. #===============================================================================#
  172. # ARE YOU MODIFYING BEYOND THIS POINT? \.\. #
  173. # YES?\.\. #
  174. # OMG, REALLY? \| #
  175. # WELL SLAP MY FACE AND CALL ME A DRAGONITE.\..\.. #
  176. # I REALLY DIDN'T THINK YOU HAD IT IN YOU.\..\.. #
  177. #===============================================================================#
  178. module Cache
  179. #===============================================================================
  180. #--------------------------------------------------------------------------
  181. # Get Windowskin
  182. #--------------------------------------------------------------------------
  183. def self.bgs(name, hue=0)
  184. load_bitmap(Scene_Backgrounds::Folder, name, hue) rescue bg_rescue(name)
  185. end
  186. #--------------------------------------------------------------------------
  187. # Error Message For Missing Images
  188. #--------------------------------------------------------------------------
  189. def self.bg_rescue(filename)
  190. text = "The Image '#{filename}' Was NOT Found.\n"
  191. text += "Please Put This Image Into The Following Folder\n'"
  192. text += "'#{Scene_Backgrounds::Folder}'\n"
  193. text += "If You Do Not Have The File, Fix The Customisation \n"
  194. text += "Within The '$D13x Scene Backgrounds' Script\n"
  195. msgbox(text)
  196. end
  197.  
  198. end
  199.  
  200. #===============================================================================
  201. class Scene_BGs < Plane
  202. #===============================================================================
  203. #--------------------------------------------------------------------------
  204. # Initialize
  205. #--------------------------------------------------------------------------
  206. def initialize(bg, id, hue = 0)
  207. super(nil)
  208. @de_bg = bg
  209. self.bitmap = Cache.bgs(bg[0], bg[6])
  210. @x_pos = bg[1]
  211. @y_pos = bg[2]
  212. @x_move = bg[3]
  213. @y_move = bg[4]
  214. self.z = bg[5]
  215. self.opacity = bg[7]
  216. self.ox = @x_pos
  217. self.oy = @y_pos
  218. end
  219. #--------------------------------------------------------------------------
  220. # Dispose
  221. #--------------------------------------------------------------------------
  222. def dispose
  223. super
  224. end
  225. #--------------------------------------------------------------------------
  226. # Update
  227. #--------------------------------------------------------------------------
  228. def update
  229. @x_pos += (@x_move / 4.0) if @x_move != 0
  230. @y_pos += (@y_move / 4.0) if @y_move != 0
  231. self.ox = @x_pos
  232. self.oy = @y_pos
  233. if self.opacity < @de_bg[8]
  234. self.opacity += 1
  235. end
  236. end
  237.  
  238. end
  239.  
  240. #===============================================================================
  241. class Scene_Base
  242. #===============================================================================
  243. #--------------------------------------------------------------------------
  244. # Alias List
  245. #--------------------------------------------------------------------------
  246. alias :start_scene_bg :start
  247. alias :disaliass :dispose_main_viewport
  248. alias :update_scene_bg :update
  249. #--------------------------------------------------------------------------
  250. # Start Processing
  251. #--------------------------------------------------------------------------
  252. def start
  253. start_scene_bg
  254. get_all_bgs
  255. create_all_bgs
  256. end
  257. #--------------------------------------------------------------------------
  258. # Termination Processing
  259. #--------------------------------------------------------------------------
  260. def dispose_main_viewport
  261. terminate_all_bgs
  262. disaliass
  263. end
  264. #--------------------------------------------------------------------------
  265. # Update
  266. #--------------------------------------------------------------------------
  267. def update
  268. upadte_backgrounds
  269. update_scene_bg
  270. end
  271. #--------------------------------------------------------------------------
  272. # Create Backgrounds
  273. #--------------------------------------------------------------------------
  274. def get_all_bgs
  275. @bg_set = Scene_Backgrounds::BGs[:default]
  276. end
  277. #--------------------------------------------------------------------------
  278. # Create Backgrounds
  279. #--------------------------------------------------------------------------
  280. def create_all_bgs
  281. return if self.class == Scene_Title
  282. return if @bg_set == nil
  283. @bks = []
  284. @bg_set.each do |bg|
  285. id = @bks.size
  286. @bks[id] = Scene_BGs.new(bg,id,bg[5])
  287. end
  288. end
  289. #--------------------------------------------------------------------------
  290. # Terminate BGs
  291. #--------------------------------------------------------------------------
  292. def terminate_all_bgs
  293. return unless @bks
  294. @bks.each { |bg| bg.dispose }
  295. end
  296. #--------------------------------------------------------------------------
  297. # Update Backgrounds
  298. #--------------------------------------------------------------------------
  299. def upadte_backgrounds
  300. return unless @bks
  301. return if self.class == Scene_Title
  302. @bks.each { |bg| bg.update }
  303. end
  304. #--------------------------------------------------------------------------
  305. # Get Transition Speed ( overwrite )
  306. #--------------------------------------------------------------------------
  307. def transition_speed
  308. return Scene_Backgrounds::Transition_Speed
  309. end
  310.  
  311. end
  312.  
  313. #===============================================================================
  314. class Scene_Menu < Scene_MenuBase
  315. #===============================================================================
  316. #--------------------------------------------------------------------------
  317. # Create Backgrounds
  318. #--------------------------------------------------------------------------
  319. def get_all_bgs
  320. @bg_set = Scene_Backgrounds::BGs[:scene_menu]
  321. end
  322.  
  323. end
  324.  
  325. #===============================================================================
  326. class Scene_Item < Scene_ItemBase
  327. #===============================================================================
  328. #--------------------------------------------------------------------------
  329. # Create Backgrounds
  330. #--------------------------------------------------------------------------
  331. def get_all_bgs
  332. @bg_set = Scene_Backgrounds::BGs[:scene_item]
  333. end
  334.  
  335. end
  336.  
  337. #===============================================================================
  338. class Scene_Skill < Scene_ItemBase
  339. #===============================================================================
  340. #--------------------------------------------------------------------------
  341. # Create Backgrounds
  342. #--------------------------------------------------------------------------
  343. def get_all_bgs
  344. @bg_set = Scene_Backgrounds::BGs[:scene_skill]
  345. end
  346.  
  347. end
  348.  
  349. #===============================================================================
  350. class Scene_Equip < Scene_MenuBase
  351. #===============================================================================
  352. #--------------------------------------------------------------------------
  353. # Create Backgrounds
  354. #--------------------------------------------------------------------------
  355. def get_all_bgs
  356. @bg_set = Scene_Backgrounds::BGs[:scene_equip]
  357. end
  358.  
  359. end
  360.  
  361. #===============================================================================
  362. class Scene_Status < Scene_MenuBase
  363. #===============================================================================
  364. #--------------------------------------------------------------------------
  365. # Create Backgrounds
  366. #--------------------------------------------------------------------------
  367. def get_all_bgs
  368. @bg_set = Scene_Backgrounds::BGs[:scene_status]
  369. end
  370.  
  371. end
  372.  
  373. #===============================================================================
  374. class Scene_File < Scene_MenuBase
  375. #===============================================================================
  376. #--------------------------------------------------------------------------
  377. # Alias List
  378. #--------------------------------------------------------------------------
  379. alias :csv_scene_BGs :create_savefile_viewport
  380. #--------------------------------------------------------------------------
  381. # Create Save File Viewport
  382. #--------------------------------------------------------------------------
  383. def create_savefile_viewport
  384. csv_scene_BGs
  385. @savefile_viewport.z = 100
  386. end
  387.  
  388. end
  389.  
  390. #===============================================================================
  391. class Scene_Save < Scene_File
  392. #===============================================================================
  393. #--------------------------------------------------------------------------
  394. # Create Backgrounds
  395. #--------------------------------------------------------------------------
  396. def get_all_bgs
  397. @bg_set = Scene_Backgrounds::BGs[:scene_save]
  398. end
  399.  
  400. end
  401.  
  402. #===============================================================================
  403. class Scene_Load < Scene_File
  404. #===============================================================================
  405. #--------------------------------------------------------------------------
  406. # Create Backgrounds
  407. #--------------------------------------------------------------------------
  408. def get_all_bgs
  409. @bg_set = Scene_Backgrounds::BGs[:scene_load]
  410. end
  411.  
  412. end
  413.  
  414. #===============================================================================
  415. class Scene_End < Scene_MenuBase
  416. #===============================================================================
  417. #--------------------------------------------------------------------------
  418. # Create Backgrounds
  419. #--------------------------------------------------------------------------
  420. def get_all_bgs
  421. @bg_set = Scene_Backgrounds::BGs[:scene_end]
  422. end
  423.  
  424. end
  425.  
  426. #===============================================================================
  427. class Scene_Shop < Scene_MenuBase
  428. #===============================================================================
  429. #--------------------------------------------------------------------------
  430. # Create Backgrounds
  431. #--------------------------------------------------------------------------
  432. def get_all_bgs
  433. @bg_set = Scene_Backgrounds::BGs[:scene_shop]
  434. end
  435.  
  436. end
  437.  
  438. #===============================================================================
  439. class Scene_Name < Scene_MenuBase
  440. #===============================================================================
  441. #--------------------------------------------------------------------------
  442. # Create Backgrounds
  443. #--------------------------------------------------------------------------
  444. def get_all_bgs
  445. @bg_set = Scene_Backgrounds::BGs[:scene_name]
  446. end
  447.  
  448. end
  449.  
  450. #===============================================================================
  451. class Scene_Debug < Scene_MenuBase
  452. #===============================================================================
  453. #--------------------------------------------------------------------------
  454. # Create Backgrounds
  455. #--------------------------------------------------------------------------
  456. def get_all_bgs
  457. @bg_set = Scene_Backgrounds::BGs[:scene_debug]
  458. end
  459.  
  460. end
  461.  
  462. #===============================================================================
  463. class Scene_Gameover < Scene_Base
  464. #===============================================================================
  465. #--------------------------------------------------------------------------
  466. # Create Backgrounds
  467. #--------------------------------------------------------------------------
  468. def get_all_bgs
  469. @bg_set = Scene_Backgrounds::BGs[:scene_gameover]
  470. end
  471. #--------------------------------------------------------------------------
  472. # Get Fade In Speed
  473. #--------------------------------------------------------------------------
  474. def fadein_speed
  475. return 0
  476. end
  477.  
  478. end
  479.  
  480. #==============================================================================#
  481. # http://dekitarpg.wordpress.com/ #
  482. #==============================================================================#
  483. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement