Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Title Screen Edit.

Hi, I'd like a simple edit of the default title screen, so that you have to press the confirm button for the default options(New Game, Continue, End.) to show up. Instead of them just appearing.
And I would like this to show up with a picture, and erase the picture once the button is pressed.(the picture is simply called 'press-start').
So could someone do this for me? Thanks in advance. :smile:
 

khmp

Sponsor

Like this:
Code:
#==============================================================================
# ** Scene_Title
#------------------------------------------------------------------------------
#  This class performs title screen processing.
#==============================================================================

class Scene_Title
  #--------------------------------------------------------------------------
  # * Constant Variables
  #--------------------------------------------------------------------------
  Press_Enter_Dir = 'Graphics/Pictures/'
  Press_Enter_Sprite = 'press-enter'
  Press_Enter_Sprite_X = 320
  Press_Enter_Sprite_Y = 300
  #--------------------------------------------------------------------------
  # * Alias Methods
  #--------------------------------------------------------------------------
  alias_method :trio_splash_scene_title_update, :update
  #--------------------------------------------------------------------------
  # * Main Processing                                              !OVERRIDE!
  #--------------------------------------------------------------------------
  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
    @sprite.bitmap = RPG::Cache.title($data_system.title_name)
    # Make command window
    s1 = "New Game"
    s2 = "Continue"
    s3 = "Shutdown"
    @command_window = Window_Command.new(192, [s1, s2, s3])
    @command_window.back_opacity = 160
    @command_window.x = 320 - @command_window.width / 2
    @command_window.y = 288
    
    # Disable it from being seen.
    @command_window.visible = false
    
    @sprite_press = Sprite.new
    begin
      @sprite_press.bitmap = Bitmap.new(Press_Enter_Dir + Press_Enter_Sprite)
    rescue
      @sprite_press.bitmap = Bitmap.new(150, 32)
      @sprite_press.bitmap.draw_text(0, 0, 150, 32, 'Bitmap not found!', 1)
    end
    @sprite_press.x = Press_Enter_Sprite_X
    @sprite_press.y = Press_Enter_Sprite_Y
    @sprite_press.opacity = 100
    
    # 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
      @command_window.index = 1
    else
      @command_window.disable_item(1)
    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 command window
    @command_window.dispose
    @sprite_press.bitmap.dispose
    @sprite_press.dispose
    # Dispose of title graphic
    @sprite.bitmap.dispose
    @sprite.dispose
  end
  #--------------------------------------------------------------------------
  # * Frame Update                                                    !ALIAS!
  #--------------------------------------------------------------------------
  def update
    if @sprite_press.visible
      @sprite_press.opacity += 2
      if Input.trigger?(Input::C)
        @sprite_press.visible = false
        @command_window.visible = true
      end
    else
      trio_splash_scene_title_update
    end
  end
end

Play with the constants at the top to get the effect you want. If you see the text "Bitmap not found!" you misplaced the picture or the constant is incorrect.

Good luck with it Triforce! :thumb:
 

khmp

Sponsor

You didn't replace the default Scene_Title code. Did you? If you did. Restore the original Scene_Title script back to the default. Then insert an empty section above main and paste in the code I gave you.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top