Advertisement
Dekita

Scene Backgrounds v1.0

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