Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if true # << Make true to use this script, false to disable.
- #===============================================================================
- #
- # ☆ $D13x - Title
- # -- Author : Dekita
- # -- Version : 1.0
- # -- Level : Easy
- # -- Requires : N/A
- # -- Engine : RPG Maker VX Ace.
- #
- #===============================================================================
- # ☆ Import
- #-------------------------------------------------------------------------------
- $D13x={}if$D13x==nil
- $D13x[:Title] = true
- #===============================================================================
- # ☆ Updates
- #-------------------------------------------------------------------------------
- # D /M /Y
- # o1/o4/2o13 - Update for release,(v1.0)
- # 14/o3/2o13 - General Update,
- # 27/o2/2o13 - Started, Finished,
- #
- #===============================================================================
- # ☆ Introduction
- #-------------------------------------------------------------------------------
- # This is a simple title screen script.
- # It allows for multiple Backgrounds, a graphic logo and graphic commands.
- #
- # This script allows for a randomly generated logo to be displayed
- # with a hue value, also allows each background and command graphic
- # to be displayed using the chosen logo's hue value.
- #
- #===============================================================================
- # ★☆★☆★☆★☆★☆★☆★☆★ TERMS AND CONDITIONS: ☆★☆★☆★☆★☆★☆★☆★☆★☆
- #===============================================================================
- # 1. You MUST give credit to "Dekita" !!
- # 2. You are NOT allowed to repost this script.(or modified versions)
- # 3. You are NOT allowed to convert this script.
- # 4. You are NOT allowed to use this script for Commercial games.
- # 5. ENJOY!
- #
- # "FINE PRINT"
- # By using this script you hereby agree to the above terms and conditions,
- # if any violation of the above terms occurs "legal action" may be taken.
- # Not understanding the above terms and conditions does NOT mean that
- # they do not apply to you.
- # If you wish to discuss the terms and conditions in further detail you can
- # contact me at http://dekitarpg.wordpress.com/ or DekitaRPG@gmail.com
- #
- #===============================================================================
- # ☆ Instructions
- #-------------------------------------------------------------------------------
- # Place Below " ▼ Materials " and Above " ▼ Main " in your script editor.
- # Place ALL Graphics in a new folder named "$D13x" within the graphics folder.
- # You can then use sub-directories if you wish :)
- # eg. Graphics/$D13x/Title/Commands/Another_Directory/_Yet_Another_Directory
- #
- #===============================================================================
- module TITLE
- #===============================================================================
- BGs=[]# << Keep
- Logo=[]# << Keep
- Folder = "$D13x/"
- # Importance value for main logo graphic
- Logo_z = 10
- # Logo will randomly be generated,
- # the chosen logo's hue will change the logo , commands
- # and background graphics with 'allow hue' set to true.
- #Logo<< [ " Graphic Name " , y , hue ]
- Logo << ["$D13x By rgangsta" , 20 , 0 ]
- Logo << ["$D13x By rgangsta" , 20 , 75 ]
- Logo << ["$D13x By rgangsta" , 20 , 130 ]
- Logo << ["$D13x By rgangsta" , 20 , 200 ]
- #BG << ['Name' ,opac, x, y, z, allow hue] (x/y are the scroll speed)
- BGs << ['BGs/StarSky_Red' , 255, 1, -1, 1, true]
- BGs << ['BGs/Fog_By_hyde' , 75, 1, -2, 1, true]
- BGs << ['BGs/Fog_By_hyde' , 75, 2, -2, 11, true]
- Command_z = 10
- # Commands Graphics.
- Commands=[
- # ["Graphic" , y, allow hue, animation, zoom x+y]
- ["Commands/NEWGAME_II" , 220, true, 112, 1.00] ,
- ["Commands/CONTINUE_II", 260, true, 112, 1.00] ,
- ["Commands/SHUTDOWN_II", 300, true, 112, 1.00] ,
- ] # << Keep
- #####################
- # CUSTOMISATION END #
- end #####################
- #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★#
- # #
- # http://dekitarpg.wordpress.com/ #
- # #
- #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆#
- #===============================================================================
- module Cache
- #===============================================================================
- #--------------------------------------------------------------------------
- # Get Title Graphic
- #--------------------------------------------------------------------------
- def self.sd13x_title(filename, hue = 0)
- load_bitmap("Graphics/#{TITLE::Folder}", filename, hue)
- end
- end
- #==============================================================================
- class Window_TitleCommand < Window_Command
- #==============================================================================
- #--------------------------------------------------------------------------
- # Update Window Position
- #--------------------------------------------------------------------------
- def update_placement
- self.x = -(window_width)
- end
- end
- #==============================================================================
- class Title_Plane < Plane
- #==============================================================================
- #--------------------------------------------------------------------------
- # Initialize
- #--------------------------------------------------------------------------
- def initialize(id, hue = 0)
- super(nil)
- @id = id
- bg = TITLE::BGs[id]
- self.bitmap = Cache.sd13x_title(bg[0], hue)
- self.opacity = 0
- self.z = bg[4]
- @x_move = bg[2]
- @y_move = bg[3]
- @x_pos = @x_move != 0 ? rand(self.bitmap.width) : 0
- @y_pos = @y_move != 0 ? rand(self.bitmap.height) : 0
- self.ox = @x_pos
- self.oy = @y_pos
- end
- #--------------------------------------------------------------------------
- # Update
- #--------------------------------------------------------------------------
- def update
- @x_pos += (@x_move / 4.0) if @x_move != 0
- @y_pos += (@y_move / 4.0) if @y_move != 0
- self.ox = @x_pos
- self.oy = @y_pos
- if self.opacity < TITLE::BGs[@id][1]
- self.opacity += 1
- end
- end
- end
- #==============================================================================
- class Title_Command < Sprite_Base
- #==============================================================================
- #--------------------------------------------------------------------------
- # Initialize
- #--------------------------------------------------------------------------
- def initialize(id, hue = 0)
- super(nil)
- @com = TITLE::Commands[id]
- self.bitmap = Cache.sd13x_title(@com[0], hue)
- self.zoom_x = self.zoom_y = @com[4]
- self.x = Graphics.width / 2 - (self.bitmap.width / 2 * @com[4])
- self.y = @com[1]
- self.z = TITLE::Command_z
- self.opacity = 0
- end
- #--------------------------------------------------------------------------
- # Update
- #--------------------------------------------------------------------------
- def update
- super
- if self.opacity < 250
- self.opacity += 1
- end
- end
- #--------------------------------------------------------------------------
- # Select Command
- #--------------------------------------------------------------------------
- def select_command
- anim = $data_animations[@com[3]]
- mirror = false
- @animation_id = @com[3]
- start_animation(anim, mirror)
- update
- end
- end
- #==============================================================================
- class Scene_Title < Scene_Base
- #==============================================================================
- #--------------------------------------------------------------------------
- # alias List
- #--------------------------------------------------------------------------
- alias :sd13x_title_start :start
- alias :dispo_title_sd13x :dispose_background
- alias :sd13x_cnewgame :command_new_game
- alias :sd13x_continue :command_continue
- alias :sd131x_shutdown :command_shutdown
- #--------------------------------------------------------------------------
- # Start Processing
- #--------------------------------------------------------------------------
- def start
- create_logos
- create_commands
- create_backgrounds
- sd13x_title_start
- end
- #--------------------------------------------------------------------------
- # Transition Speed
- #--------------------------------------------------------------------------
- def transition_speed
- return 0
- end
- #--------------------------------------------------------------------------
- # Create Backgrounds
- #--------------------------------------------------------------------------
- def create_backgrounds
- @bgs = []
- TITLE::BGs.each do |bg|
- id = @bgs.size
- @bgs[id] = Title_Plane.new(id, @the_HUE)
- end
- end
- #--------------------------------------------------------------------------
- # Create Logos
- #--------------------------------------------------------------------------
- def create_logos
- id = rand(TITLE::Logo.size)
- @the_HUE = TITLE::Logo[id][2]
- p @the_HUE
- @system = Sprite.new
- @system.bitmap = Cache.sd13x_title(TITLE::Logo[id][0],@the_HUE)
- @system.x = Graphics.width/2-(@system.bitmap.width/2*@system.zoom_x)
- @system.y = TITLE::Logo[id][1]
- @system.z = TITLE::Logo_z
- @system.opacity = 0
- end
- #--------------------------------------------------------------------------
- # Create Command Logos
- #--------------------------------------------------------------------------
- def create_commands
- @commands = []
- 3.times do |i|
- hue = TITLE::Commands[i][2] == true ? @the_HUE : 0
- @commands[i] = Title_Command.new(i, hue)
- end
- end
- #--------------------------------------------------------------------------
- # Free Background
- #--------------------------------------------------------------------------
- def dispose_background
- dispo_title_sd13x
- @system.bitmap.dispose
- @system.dispose
- @commands.each do |com|
- com.dispose
- end
- @bgs.each do |this|
- this.bitmap.dispose if this != nil
- this.dispose if this != nil
- end
- end
- #--------------------------------------------------------------------------
- # Update
- #--------------------------------------------------------------------------
- def update
- old_com_pos = @command_window.index
- super
- if @command_window.index == 1 && !DataManager.save_file_exists?
- @command_window.index = old_com_pos == 0 ? 2 : 0
- end
- update_needed
- end
- #--------------------------------------------------------------------------
- # Update Needed
- #--------------------------------------------------------------------------
- def update_needed
- update_effects
- update_bgs
- end
- #--------------------------------------------------------------------------
- # Update Backgrounds
- #--------------------------------------------------------------------------
- def update_bgs
- @bgs.each { |bg| bg.update }
- end
- #--------------------------------------------------------------------------
- # Update Opacity
- #--------------------------------------------------------------------------
- def update_effects
- @system.opacity += 1 if @system.opacity < 250
- return if @system.opacity < 100
- 3.times do |i|
- if i == @command_window.index
- @commands[i].opacity += 2
- else
- if @commands[i].opacity < 60
- @commands[i].opacity += 1
- elsif @commands[i].opacity > 60
- @commands[i].opacity = 60
- end
- end
- end
- end
- #--------------------------------------------------------------------------
- # [New Game] Command
- #--------------------------------------------------------------------------
- def command_new_game
- do_select_cmnd
- sd13x_cnewgame
- end
- #--------------------------------------------------------------------------
- # [Continue] Command
- #--------------------------------------------------------------------------
- def command_continue
- do_select_cmnd
- sd13x_continue
- end
- #--------------------------------------------------------------------------
- # [Shut Down] Command
- #--------------------------------------------------------------------------
- def command_shutdown
- do_select_cmnd
- sd131x_shutdown
- end
- #--------------------------------------------------------------------------
- # [Select command] Command
- #--------------------------------------------------------------------------
- def do_select_cmnd
- Audio.bgm_fade(1000)
- @commands[@command_window.index].select_command
- loop do
- break if Graphics.brightness <= 0
- @commands[@command_window.index].update
- update_needed
- Graphics.update
- Graphics.brightness -= 2
- Graphics.brightness -= 2 if Graphics.brightness < 200
- Graphics.brightness -= 2 if Graphics.brightness < 100
- end
- end
- end
- #===============================================================================#
- # http://dekitarpg.wordpress.com/ #
- #===============================================================================#
- end # if true # << Make true to use this script, false to disable.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement