Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #===============================================================================
- # RSM's SCENE SLIDESHOW ACE (2Kx LOGO) BETA
- #-------------------------------------------------------------------------------
- # Description: Enables the addition of a slideshow of images that can also be
- # used as a logo before the title screen, like the one in
- # RPG Maker 2000/2003. You can also select a background music and
- # use as a scene in the map using the specific command.
- #-------------------------------------------------------------------------------
- # ATTENTION! This is a BETA version, there is still a issue with the music
- # if you try to run it. Still needs polishment and proper documentation.
- # Please be patient. Thanks!
- #
- # How to Use:
- # All images goes into the folder 'Graphics/Slideshow/';
- # To use it in-game, use the following command in 'Call Script':
- #
- # show_slideshow(['img1','img2',..., 'imgN'], <'music'>, <wait_time>,
- # <fadein_time>, <fadeout_time>, <next_scene>, <skippable>
- #
- # OBS.: ['img1','img2'] -> Put all your image names between quotes, all inside
- # the brackets, separated
- # <'music'> is the filename of the music you wanto to play.
- # <wait_time> is given in seconds;
- # <fade_in_time>, <fade_out_time> are given in frames
- # (roughly 60 are equal to 1 second);
- # Parameters between <> are are optional.
- # (BETTER DESCRIPTION AND INSTRUCTIONS TO COME)
- #-------------------------------------------------------------------------------
- # Special Thanks: PRCoders
- #-------------------------------------------------------------------------------
- #===============================================================================
- #===============================================================================
- # UPDATES
- #-------------------------------------------------------------------------------
- # VX SCENE INTRO -> SCENE SLIDESHOW ACE (conversion from RGSS2 to RGSS3)
- # * Large structural change, to fit the new SceneManager and DataManager.
- #-------------------------------------------------------------------------------
- #===============================================================================
- #==============================================================================
- # ** Cache
- #------------------------------------------------------------------------------
- module Configurables
- module Slideshow
- Show_Before_Title_Screen = true
- Default_Pictures = ['Splashscreen']
- Default_Music = 'Theme2'
- end
- end
- #==============================================================================
- # ** Cache
- #------------------------------------------------------------------------------
- module Cache
- def self.slideshows(filename)
- load_bitmap('Graphics/Slideshows/', filename)
- end
- end
- #==============================================================================
- # ** DataManager
- #------------------------------------------------------------------------------
- module DataManager
- class << self
- alias rsm_sldshw_ace_create_game_objects create_game_objects
- end
- def self.create_game_objects
- rsm_sldshw_ace_create_game_objects
- $game_slideshow = Game_Slideshow.new
- end
- end
- #==============================================================================
- # ** SceneManager
- #------------------------------------------------------------------------------
- module SceneManager
- include Configurables::Slideshow
- def self.first_scene_class
- $BTEST ? Scene_Battle :
- (Show_Before_Title_Screen ? Scene_Slideshow : Scene_Title)
- end
- end
- #==============================================================================
- # ** Game_Slideshow
- #------------------------------------------------------------------------------
- class Game_Slideshow
- include Configurables::Slideshow
- attr_accessor :pictures
- attr_accessor :music
- attr_accessor :wait_time
- attr_accessor :fade_in_time
- attr_accessor :fade_out_time
- attr_accessor :allow_skipping
- attr_accessor :next_scene
- #--------------------------------------------------------------------------
- # *
- #--------------------------------------------------------------------------
- def initialize
- # Setup for first time use (default values, used in splascreen)
- setup(Default_Pictures, Default_Music, 4, 60, 60, :scene_title, true)
- end
- #--------------------------------------------------------------------------
- # *
- #--------------------------------------------------------------------------
- def setup(pictures, music, wait_time, fade_in_time, fade_out_time,
- next_scene, allow_skipping)
- @pictures = pictures
- @music = music
- @wait_time = wait_time
- @fade_in_time = fade_in_time
- @fade_out_time = fade_out_time
- @next_scene = next_scene
- @allow_skipping = allow_skipping
- end
- end
- #==============================================================================
- # ** Game_Interpreter
- #------------------------------------------------------------------------------
- class Game_Interpreter
- def play_slideshow(pictures, music, wait = 4, fade_in = 60, fade_out = 60,
- next_scene = :scene_map, skippable = true)
- $game_slideshow.setup(pictures, music, wait, fade_in, fade_out,
- next_scene, skippable)
- SceneManager.goto(Scene_Slideshow)
- end
- end
- #==============================================================================
- # ** Scene_Slideshow
- #------------------------------------------------------------------------------
- class Scene_Slideshow < Scene_Base
- #--------------------------------------------------------------------------
- # * Preparing the backstage of the scene
- #--------------------------------------------------------------------------
- def auto_setup
- @pictures = $game_slideshow.pictures
- @music = $game_slideshow.music
- @wait_time = $game_slideshow.wait_time
- @fade_in_time = $game_slideshow.fade_in_time
- @fade_out_time = $game_slideshow.fade_out_time
- @allow_skipping = $game_slideshow.allow_skipping
- @next_scene = $game_slideshow.next_scene
- end
- #--------------------------------------------------------------------------
- # * Main processing
- #--------------------------------------------------------------------------
- def start
- super
- @time_count = Graphics.frame_count
- auto_setup
- play_music
- prepare_fadein
- create_pictures
- execute_fadein
- end
- #--------------------------------------------------------------------------
- # * Terminating the process
- #--------------------------------------------------------------------------
- def terminate
- super
- dispose_pictures
- replay_last_music
- end
- #--------------------------------------------------------------------------
- # * Screen update
- #--------------------------------------------------------------------------
- def update
- super
- next_scene if Input.trigger?(:A)||Input.trigger?(:B)||
- Input.trigger?(:X)||Input.trigger?(:Y)|| wait(@wait_time)
- end
- #--------------------------------------------------------------------------
- # * Execution of the transition
- #--------------------------------------------------------------------------
- def perform_transition
- Graphics.transition(@fade_in_time)
- end
- #--------------------------------------------------------------------------
- # *
- #--------------------------------------------------------------------------
- def wait(time)
- Graphics.frame_count >= @time_count + (time * Graphics.frame_rate)
- end
- #--------------------------------------------------------------------------
- # * Playing the music
- #--------------------------------------------------------------------------
- def play_music
- unless @music.nil?
- RPG::BGM.stop
- RPG::BGS.stop
- Audio.bgm_play ('Audio/BGM/' + @music)
- end
- end
- #--------------------------------------------------------------------------
- # *
- #--------------------------------------------------------------------------
- def replay_last_music
- unless @music.nil?
- RPG::BGM.last.play
- RPG::BGS.last.play
- end
- end
- #--------------------------------------------------------------------------
- # *
- #--------------------------------------------------------------------------
- def fade_out_music
- unless @music.nil?
- time = @fade_out_time * 33.33
- ME.fade(time)
- SE.stop
- Audio.bgm_fade(time)
- Audio.bgs_fade(time)
- end
- end
- #--------------------------------------------------------------------------
- # * Fade out and freezing the screen
- #--------------------------------------------------------------------------
- def prepare_fadein
- Graphics.fadeout(0)
- Graphics.freeze
- end
- #--------------------------------------------------------------------------
- # * Creation of the background
- #--------------------------------------------------------------------------
- def execute_fadein
- Graphics.fadein(@fade_in_time)
- end
- #--------------------------------------------------------------------------
- # *
- #--------------------------------------------------------------------------
- def create_pictures
- @sprite = Sprite.new
- @sprite.bitmap = Cache.slideshows(@pictures[0])
- end
- #--------------------------------------------------------------------------
- # * Disposing of the background
- #--------------------------------------------------------------------------
- def dispose_pictures
- @sprite.bitmap.dispose
- @sprite.dispose
- end
- #--------------------------------------------------------------------------
- # * Transition for the next scene
- #--------------------------------------------------------------------------
- def next_scene
- fadeout_all
- case @next_scene
- when :scene_title
- SceneManager.goto(Scene_Title)
- when :scene_map
- SceneManager.goto(Scene_Map)
- end
- end
- end
- #-------------------------------------------------------------------------------
- # * THE END - That's all, folks!
- #-------------------------------------------------------------------------------
- #===============================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement