#------------------------------------------------------------------------------
# Add Credits on the Title Screen.
#
# https://burningwizard.wordpress.com/2014/03/04/rgss3-credits-script/
#------------------------------------------------------------------------------
=begin
#==============================================================================
# MIT License
#==============================================================================
Copyright 2014-2024 Black Mage
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the “Software”), to deal in
the Software without restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#==============================================================================
=end
#==============================================================================
# Changelog
#==============================================================================
# Version 1.2 (2024 - 8 - 2)
# - Change the way the credits is set up in the script.
# - Make the Credits scrollable.
#
# Version 1.1 (2014 - 7 - 18)
# - Fix some issues.
#
# Version 1.0 (2014 - 3 - 4)
# - Initial version.
#==============================================================================
#-------------------------------------------------------------------------------
# Settings
#-------------------------------------------------------------------------------
module BLACK
# A credit example. It starts with " and end with another ".
Credits = "
---------------------------------------------------------------------------
Example Game
---------------------------------------------------------------------------
Developed by: Black Mage
Engine: RPG Maker VX Ace
Director & Producer: Black Mage
Storywriter:
Black Mage
Programmer:
Black Mage
" #Don't erase this.
end
# End of Settings -------------------------------------------------------------
#------------------------------------------------------------------------------
# * Beyond this is the sacred land of code. You need programming qualification
# to dwelve deeper, or it'll cause many unnecessary problems. Proceed on your
# own risk.
#------------------------------------------------------------------------------
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
def command_credits
close_command_window
SceneManager.call(Scene_Credits)
end
end
class Window_Credits < Window_Base
def initialize; super(0, 0, window_width, 416); refresh; end
def window_width; Graphics.width; end
def refresh
contents.clear
self.contents = Bitmap.new(width - 24, line_height*(BLACK::Credits.count("\n") + 1))
draw_text_ex(0,0,BLACK::Credits)
end
def open; refresh; super; end
def update
super
process_cursor_move
end
def process_cursor_move
return if !self.active
press_down if Input.repeat?(:DOWN)
press_up if Input.repeat?(:UP)
end
def press_down
self.oy += line_height if self.oy < [self.contents.height - self.height + 24, 0].max
end
def press_up
self.oy -= line_height if self.oy > 0
end
end
class Scene_Credits < Scene_MenuBase
def start; super; create_credits_window; end
def create_credits_window
@credits_window = Window_Credits.new
@credits_window.x = 0
@credits_window.y = 0
end
def update; super; update_credits; end
def update_credits
return credits_return if Input.trigger?(:C)
return credits_return if Input.trigger?(:B)
end
def credits_return; Sound.play_cancel; SceneManager.goto(Scene_Title); end
end
Comments
0 B
|👍
/👎