Jump to content
Tomasque

Main Menu Credits Button

Recommended Posts

I'm looking for a script that adds a credits button to the title screen which makes the screen fade to black, then fade back in on a full-screen image (my credits). When the player presses the Z button, the image fades to black, and the title fades in and the command window pops back up.

 

I tried following the advice on this thread, but I've run into trouble.

 

I've understood it well enough to import the code which adds a Credits button that runs "msgbox_p". However, when TBWCS goes into further detail about how it could be used to fade to an image, I get lost. This is the code I've imported:

Spoiler

class Window_TitleCommand < Window_Command
  # * Create Command List
  #--------------------------------------------------------------------------
  alias new_make_command_list make_command_list
  def make_command_list
    add_command(Vocab::new_game, :new_game)
    add_command(Vocab::continue, :continue, continue_enabled)
    add_command("Credits",        :credits)
    add_command(Vocab::shutdown, :shutdown)
  end
end

module Scene_Credits
  def self.start_credits
    msgbox_p "Hello, put credits here"
  end
end


class Scene_Title < Scene_Base
  #--------------------------------------------------------------------------
  # * [Cedits] Command
  #--------------------------------------------------------------------------
  def command_credits
    close_command_window
    fadeout_all
    Scene_Credits.start_credits
  end

  def create_command_window
    @command_window = Window_TitleCommand.new
    @command_window.set_handler(:new_game, method(:command_new_game))
    @command_window.set_handler(:continue, method(:command_continue))
    @command_window.set_handler(:credits, method(:command_credits))    
    @command_window.set_handler(:shutdown, method(:command_shutdown))

  end  
  
end

 

If you could explain to me how to get from the code above to the code that I need, I'd be super thankful. 

 

(I'm using Yanfly's "Menu Cursor v1.00" script. I don't know if that'll cause any issues.)

Share this post


Link to post
Share on other sites

Is it just one image?

Spoiler

class Window_TitleCommand < Window_Command
  def make_command_list
    add_command(Vocab::new_game, :new_game)
    add_command(Vocab::continue, :continue, continue_enabled)
    add_command("Credits",        :credits)
    add_command(Vocab::shutdown, :shutdown)
  end
end

class Scene_Title < Scene_Base

  def create_command_window
    @command_window = Window_TitleCommand.new
    @command_window.set_handler(:new_game, method(:command_new_game))
    @command_window.set_handler(:continue, method(:command_continue))
    @command_window.set_handler(:credits,  method(:command_credits) )    
    @command_window.set_handler(:shutdown, method(:command_shutdown))
  end  
	
  #--------------------------------------------------------------------------
  # * [Cedits] Command
  #--------------------------------------------------------------------------
  def command_credits
    close_command_window
    fadeout_all
    SceneManager.goto(Scene_Credits)
  end
 
end

class Scene_Credits < Scene_Base
  #--------------------------------------------------------------------------
  # * Start Processing
  #--------------------------------------------------------------------------
  def start
    super
    play_credit_music
    fadeout_frozen_graphics
    create_background
  end
  #--------------------------------------------------------------------------
  # * Termination Processing
  #--------------------------------------------------------------------------
  def terminate
    super
    dispose_background
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    super
    goto_title if Input.trigger?(:C)
  end
  #--------------------------------------------------------------------------
  # * Execute Transition
  #--------------------------------------------------------------------------
  def perform_transition
    Graphics.transition(fadein_speed)
  end
  #--------------------------------------------------------------------------
  # * Play Music on Credit Screen
  #--------------------------------------------------------------------------
  def play_credit_music
    RPG::BGM.stop
    RPG::BGS.stop
    RPG::BGM.new("credits_music", 100, 100).play
  end
  #--------------------------------------------------------------------------
  # * Fade Out Frozen Graphics
  #--------------------------------------------------------------------------
  def fadeout_frozen_graphics
    Graphics.transition(fadeout_speed)
    Graphics.freeze
  end
  #--------------------------------------------------------------------------
  # * Create Background
  #--------------------------------------------------------------------------
  def create_background
    @sprite = Sprite.new
    @sprite.bitmap = Cache.system("Credits")
  end
  #--------------------------------------------------------------------------
  # * Free Background
  #--------------------------------------------------------------------------
  def dispose_background
    @sprite.bitmap.dispose
    @sprite.dispose
  end
  #--------------------------------------------------------------------------
  # * Get Fade Out Speed
  #--------------------------------------------------------------------------
  def fadeout_speed
    return 60
  end
  #--------------------------------------------------------------------------
  # * Get Fade In Speed
  #--------------------------------------------------------------------------
  def fadein_speed
    return 120
  end
  #--------------------------------------------------------------------------
  # * Transition to Title Screen
  #--------------------------------------------------------------------------
  def goto_title
    fadeout_all
    SceneManager.goto(Scene_Title)
  end
end

 

 

  • Thanks 1

Share this post


Link to post
Share on other sites

Yeah, just one image.

 

Thank you so much for the code, and for making it super legible. There were some adjustments I needed to make (I didn't want my title music to fade out), but I was able to do it no problem.

 

Could I send you a copy of the game when it's done?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
Top ArrowTop Arrow Highlighted