[XP] Need Three Image Title Script (Or Something like that)

Started by Darok, June 09, 2009, 06:18:26 pm

Previous topic - Next topic

Darok

I hear about this Script, And i really need it for my Proyect!
Please, I will Leval Up the one that give me the Script =P

Aqua

I have it... I /think/ it's by ccoa, but I'm not sure...

Spoiler: ShowHide

SEPERATE_CONTINUE_DISABLED_IMAGES = true
TRANSITION_FRAMES = 8

class Scene_Title
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    # If battle test
    if $BTEST
      battle_test
      return
    end
    # Load database
    $data_actors        = load_data("Data/Actors.rxdata")
    $data_classes       = load_data("Data/Classes.rxdata")
    $data_skills        = load_data("Data/Skills.rxdata")
    $data_items         = load_data("Data/Items.rxdata")
    $data_weapons       = load_data("Data/Weapons.rxdata")
    $data_armors        = load_data("Data/Armors.rxdata")
    $data_enemies       = load_data("Data/Enemies.rxdata")
    $data_troops        = load_data("Data/Troops.rxdata")
    $data_states        = load_data("Data/States.rxdata")
    $data_animations    = load_data("Data/Animations.rxdata")
    $data_tilesets      = load_data("Data/Tilesets.rxdata")
    $data_common_events = load_data("Data/CommonEvents.rxdata")
    $data_system        = load_data("Data/System.rxdata")
    # Make system object
    $game_system = Game_System.new
    # Make title graphic
    @sprite = Sprite.new
    @back_sprite = Sprite.new
    @back_sprite.z = @sprite.z - 10
   
    @index = 0
    @count = -1
    @delta = 255 / TRANSITION_FRAMES
   
    # Continue enabled determinant
    # Check if at least one save file exists
    # If enabled, make @continue_enabled true; if disabled, make it false
    @continue_enabled = false
    for i in 0..3
      if FileTest.exist?("Save#{i+1}.rxdata")
        @continue_enabled = true
      end
    end
    # If continue is enabled, move cursor to "Continue"
    # If disabled, display "Continue" text in gray
    if @continue_enabled
      @index = 1
      @sprite.bitmap = RPG::Cache.title("1")
    else
      if SEPERATE_CONTINUE_DISABLED_IMAGES
        @sprite.bitmap = RPG::Cache.title("0d")
      else
        @sprite.bitmap = RPG::Cache.title("0")
      end
    end
    # Play title BGM
    $game_system.bgm_play($data_system.title_bgm)
    # Stop playing ME and BGS
    Audio.me_stop
    Audio.bgs_stop
    # Execute transition
    Graphics.transition
    # Main loop
    loop do
      # Update game screen
      Graphics.update
      # Update input information
      Input.update
      # Frame update
      update
      # Abort loop if screen is changed
      if $scene != self
        break
      end
    end
    # Prepare for transition
    Graphics.freeze
    # Dispose of title graphic
    @sprite.bitmap.dispose
    @sprite.dispose
    @back_sprite.dispose
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    if @count > -1
      if @count == 0
        if SEPERATE_CONTINUE_DISABLED_IMAGES and !@continue_enabled
          @sprite.bitmap = RPG::Cache.title(@index.to_s + 'd')
        else
          @sprite.bitmap = RPG::Cache.title(@index.to_s)
        end
        @sprite.opacity = 255
      else
        @sprite.opacity -= @delta
      end
      @count -= 1
      return
    end
   
    if Input.repeat?(Input::UP) or Input.repeat?(Input::LEFT)
      $game_system.se_play($data_system.cursor_se)
      @index = (@index - 1) % 3
      @count = TRANSITION_FRAMES
      if SEPERATE_CONTINUE_DISABLED_IMAGES and !@continue_enabled
        @back_sprite.bitmap = RPG::Cache.title(@index.to_s + 'd')
      else
        @back_sprite.bitmap = RPG::Cache.title(@index.to_s)
      end
    end
   
    if Input.repeat?(Input::DOWN) or Input.repeat?(Input::RIGHT)
      $game_system.se_play($data_system.cursor_se)
      @index = (@index + 1) % 3
      @count = TRANSITION_FRAMES
      if SEPERATE_CONTINUE_DISABLED_IMAGES and !@continue_enabled
        @back_sprite.bitmap = RPG::Cache.title(@index.to_s + 'd')
      else
        @back_sprite.bitmap = RPG::Cache.title(@index.to_s)
      end
    end
   
   
    # If C button was pressed
    if Input.trigger?(Input::C)
      # Branch by command window cursor position
      case @index
      when 0  # New game
        command_new_game
      when 1  # Continue
        command_continue
      when 2  # Shutdown
        command_shutdown
      end
    end
  end
end


SEPERATE_CONTINUE_DISABLED_IMAGES = true

^ If you set that to true, then it'll use a different image when you don't have any continues.
Set it to false if you don't want the different images.

The images go into the Title folder with names of 0, 1, 2.
0d, 1d, 2d are also needed if you set SEPERATE_CONTINUE_DISABLED_IMAGES to true

Darok

Thanks Aqua!! Level Up  :) :)
It works Perfectly :)

Landith

If you have any questions about what the title should look like, here is the demo with sample pictures in it.

Download Link

Just in case Aqua was confusing :P

Darok