Advertisement
Dekita

$D13x Title v1.0

Apr 2nd, 2013
1,732
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.78 KB | None | 0 0
  1. if true # << Make true to use this script, false to disable.
  2. #===============================================================================
  3. #
  4. # ☆ $D13x - Title
  5. # -- Author : Dekita
  6. # -- Version : 1.0
  7. # -- Level : Easy
  8. # -- Requires : N/A
  9. # -- Engine : RPG Maker VX Ace.
  10. #
  11. #===============================================================================
  12. # ☆ Import
  13. #-------------------------------------------------------------------------------
  14. $D13x={}if$D13x==nil
  15. $D13x[:Title] = true
  16. #===============================================================================
  17. # ☆ Updates
  18. #-------------------------------------------------------------------------------
  19. # D /M /Y
  20. # o1/o4/2o13 - Update for release,(v1.0)
  21. # 14/o3/2o13 - General Update,
  22. # 27/o2/2o13 - Started, Finished,
  23. #
  24. #===============================================================================
  25. # ☆ Introduction
  26. #-------------------------------------------------------------------------------
  27. # This is a simple title screen script.
  28. # It allows for multiple Backgrounds, a graphic logo and graphic commands.
  29. #
  30. # This script allows for a randomly generated logo to be displayed
  31. # with a hue value, also allows each background and command graphic
  32. # to be displayed using the chosen logo's hue value.
  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/ or DekitaRPG@gmail.com
  50. #
  51. #===============================================================================
  52. # ☆ Instructions
  53. #-------------------------------------------------------------------------------
  54. # Place Below " ▼ Materials " and Above " ▼ Main " in your script editor.
  55. # Place ALL Graphics in a new folder named "$D13x" within the graphics folder.
  56. # You can then use sub-directories if you wish :)
  57. # eg. Graphics/$D13x/Title/Commands/Another_Directory/_Yet_Another_Directory
  58. #
  59. #===============================================================================
  60. module TITLE
  61. #===============================================================================
  62. BGs=[]# << Keep
  63. Logo=[]# << Keep
  64.  
  65. Folder = "$D13x/"
  66.  
  67. # Importance value for main logo graphic
  68. Logo_z = 10
  69. # Logo will randomly be generated,
  70. # the chosen logo's hue will change the logo , commands
  71. # and background graphics with 'allow hue' set to true.
  72. #Logo<< [ " Graphic Name " , y , hue ]
  73. Logo << ["$D13x By rgangsta" , 20 , 0 ]
  74. Logo << ["$D13x By rgangsta" , 20 , 75 ]
  75. Logo << ["$D13x By rgangsta" , 20 , 130 ]
  76. Logo << ["$D13x By rgangsta" , 20 , 200 ]
  77.  
  78. #BG << ['Name' ,opac, x, y, z, allow hue] (x/y are the scroll speed)
  79. BGs << ['BGs/StarSky_Red' , 255, 1, -1, 1, true]
  80. BGs << ['BGs/Fog_By_hyde' , 75, 1, -2, 1, true]
  81. BGs << ['BGs/Fog_By_hyde' , 75, 2, -2, 11, true]
  82.  
  83. Command_z = 10
  84. # Commands Graphics.
  85. Commands=[
  86. # ["Graphic" , y, allow hue, animation, zoom x+y]
  87. ["Commands/NEWGAME_II" , 220, true, 112, 1.00] ,
  88. ["Commands/CONTINUE_II", 260, true, 112, 1.00] ,
  89. ["Commands/SHUTDOWN_II", 300, true, 112, 1.00] ,
  90. ] # << Keep
  91.  
  92. #####################
  93. # CUSTOMISATION END #
  94. end #####################
  95. #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★#
  96. # #
  97. # http://dekitarpg.wordpress.com/ #
  98. # #
  99. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆#
  100. #===============================================================================
  101. module Cache
  102. #===============================================================================
  103. #--------------------------------------------------------------------------
  104. # Get Title Graphic
  105. #--------------------------------------------------------------------------
  106. def self.sd13x_title(filename, hue = 0)
  107. load_bitmap("Graphics/#{TITLE::Folder}", filename, hue)
  108. end
  109.  
  110. end
  111.  
  112. #==============================================================================
  113. class Window_TitleCommand < Window_Command
  114. #==============================================================================
  115. #--------------------------------------------------------------------------
  116. # Update Window Position
  117. #--------------------------------------------------------------------------
  118. def update_placement
  119. self.x = -(window_width)
  120. end
  121.  
  122. end
  123.  
  124. #==============================================================================
  125. class Title_Plane < Plane
  126. #==============================================================================
  127. #--------------------------------------------------------------------------
  128. # Initialize
  129. #--------------------------------------------------------------------------
  130. def initialize(id, hue = 0)
  131. super(nil)
  132. @id = id
  133. bg = TITLE::BGs[id]
  134. self.bitmap = Cache.sd13x_title(bg[0], hue)
  135. self.opacity = 0
  136. self.z = bg[4]
  137. @x_move = bg[2]
  138. @y_move = bg[3]
  139. @x_pos = @x_move != 0 ? rand(self.bitmap.width) : 0
  140. @y_pos = @y_move != 0 ? rand(self.bitmap.height) : 0
  141. self.ox = @x_pos
  142. self.oy = @y_pos
  143. end
  144. #--------------------------------------------------------------------------
  145. # Update
  146. #--------------------------------------------------------------------------
  147. def update
  148. @x_pos += (@x_move / 4.0) if @x_move != 0
  149. @y_pos += (@y_move / 4.0) if @y_move != 0
  150. self.ox = @x_pos
  151. self.oy = @y_pos
  152. if self.opacity < TITLE::BGs[@id][1]
  153. self.opacity += 1
  154. end
  155. end
  156.  
  157. end
  158.  
  159. #==============================================================================
  160. class Title_Command < Sprite_Base
  161. #==============================================================================
  162. #--------------------------------------------------------------------------
  163. # Initialize
  164. #--------------------------------------------------------------------------
  165. def initialize(id, hue = 0)
  166. super(nil)
  167. @com = TITLE::Commands[id]
  168. self.bitmap = Cache.sd13x_title(@com[0], hue)
  169. self.zoom_x = self.zoom_y = @com[4]
  170. self.x = Graphics.width / 2 - (self.bitmap.width / 2 * @com[4])
  171. self.y = @com[1]
  172. self.z = TITLE::Command_z
  173. self.opacity = 0
  174. end
  175. #--------------------------------------------------------------------------
  176. # Update
  177. #--------------------------------------------------------------------------
  178. def update
  179. super
  180. if self.opacity < 250
  181. self.opacity += 1
  182. end
  183. end
  184. #--------------------------------------------------------------------------
  185. # Select Command
  186. #--------------------------------------------------------------------------
  187. def select_command
  188. anim = $data_animations[@com[3]]
  189. mirror = false
  190. @animation_id = @com[3]
  191. start_animation(anim, mirror)
  192. update
  193. end
  194.  
  195. end
  196.  
  197. #==============================================================================
  198. class Scene_Title < Scene_Base
  199. #==============================================================================
  200. #--------------------------------------------------------------------------
  201. # alias List
  202. #--------------------------------------------------------------------------
  203. alias :sd13x_title_start :start
  204. alias :dispo_title_sd13x :dispose_background
  205. alias :sd13x_cnewgame :command_new_game
  206. alias :sd13x_continue :command_continue
  207. alias :sd131x_shutdown :command_shutdown
  208. #--------------------------------------------------------------------------
  209. # Start Processing
  210. #--------------------------------------------------------------------------
  211. def start
  212. create_logos
  213. create_commands
  214. create_backgrounds
  215. sd13x_title_start
  216. end
  217. #--------------------------------------------------------------------------
  218. # Transition Speed
  219. #--------------------------------------------------------------------------
  220. def transition_speed
  221. return 0
  222. end
  223. #--------------------------------------------------------------------------
  224. # Create Backgrounds
  225. #--------------------------------------------------------------------------
  226. def create_backgrounds
  227. @bgs = []
  228. TITLE::BGs.each do |bg|
  229. id = @bgs.size
  230. @bgs[id] = Title_Plane.new(id, @the_HUE)
  231. end
  232. end
  233. #--------------------------------------------------------------------------
  234. # Create Logos
  235. #--------------------------------------------------------------------------
  236. def create_logos
  237. id = rand(TITLE::Logo.size)
  238. @the_HUE = TITLE::Logo[id][2]
  239. p @the_HUE
  240. @system = Sprite.new
  241. @system.bitmap = Cache.sd13x_title(TITLE::Logo[id][0],@the_HUE)
  242. @system.x = Graphics.width/2-(@system.bitmap.width/2*@system.zoom_x)
  243. @system.y = TITLE::Logo[id][1]
  244. @system.z = TITLE::Logo_z
  245. @system.opacity = 0
  246. end
  247. #--------------------------------------------------------------------------
  248. # Create Command Logos
  249. #--------------------------------------------------------------------------
  250. def create_commands
  251. @commands = []
  252. 3.times do |i|
  253. hue = TITLE::Commands[i][2] == true ? @the_HUE : 0
  254. @commands[i] = Title_Command.new(i, hue)
  255. end
  256. end
  257. #--------------------------------------------------------------------------
  258. # Free Background
  259. #--------------------------------------------------------------------------
  260. def dispose_background
  261. dispo_title_sd13x
  262. @system.bitmap.dispose
  263. @system.dispose
  264. @commands.each do |com|
  265. com.dispose
  266. end
  267. @bgs.each do |this|
  268. this.bitmap.dispose if this != nil
  269. this.dispose if this != nil
  270. end
  271. end
  272. #--------------------------------------------------------------------------
  273. # Update
  274. #--------------------------------------------------------------------------
  275. def update
  276. old_com_pos = @command_window.index
  277. super
  278. if @command_window.index == 1 && !DataManager.save_file_exists?
  279. @command_window.index = old_com_pos == 0 ? 2 : 0
  280. end
  281. update_needed
  282. end
  283. #--------------------------------------------------------------------------
  284. # Update Needed
  285. #--------------------------------------------------------------------------
  286. def update_needed
  287. update_effects
  288. update_bgs
  289. end
  290. #--------------------------------------------------------------------------
  291. # Update Backgrounds
  292. #--------------------------------------------------------------------------
  293. def update_bgs
  294. @bgs.each { |bg| bg.update }
  295. end
  296. #--------------------------------------------------------------------------
  297. # Update Opacity
  298. #--------------------------------------------------------------------------
  299. def update_effects
  300. @system.opacity += 1 if @system.opacity < 250
  301. return if @system.opacity < 100
  302. 3.times do |i|
  303. if i == @command_window.index
  304. @commands[i].opacity += 2
  305. else
  306. if @commands[i].opacity < 60
  307. @commands[i].opacity += 1
  308. elsif @commands[i].opacity > 60
  309. @commands[i].opacity = 60
  310. end
  311. end
  312. end
  313. end
  314. #--------------------------------------------------------------------------
  315. # [New Game] Command
  316. #--------------------------------------------------------------------------
  317. def command_new_game
  318. do_select_cmnd
  319. sd13x_cnewgame
  320. end
  321. #--------------------------------------------------------------------------
  322. # [Continue] Command
  323. #--------------------------------------------------------------------------
  324. def command_continue
  325. do_select_cmnd
  326. sd13x_continue
  327. end
  328. #--------------------------------------------------------------------------
  329. # [Shut Down] Command
  330. #--------------------------------------------------------------------------
  331. def command_shutdown
  332. do_select_cmnd
  333. sd131x_shutdown
  334. end
  335. #--------------------------------------------------------------------------
  336. # [Select command] Command
  337. #--------------------------------------------------------------------------
  338. def do_select_cmnd
  339. Audio.bgm_fade(1000)
  340. @commands[@command_window.index].select_command
  341. loop do
  342. break if Graphics.brightness <= 0
  343. @commands[@command_window.index].update
  344. update_needed
  345. Graphics.update
  346. Graphics.brightness -= 2
  347. Graphics.brightness -= 2 if Graphics.brightness < 200
  348. Graphics.brightness -= 2 if Graphics.brightness < 100
  349. end
  350. end
  351.  
  352. end
  353.  
  354. #===============================================================================#
  355. # http://dekitarpg.wordpress.com/ #
  356. #===============================================================================#
  357. end # if true # << Make true to use this script, false to disable.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement