Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #===============================================================================
- #
- # Change Fade Time (1.0a)
- # 23/02/2012
- # By Pacman (for Countdown)
- # This script will alter the number of frames it takes to fade the screen in
- # and out (with the default commands). This is done with a simple script call.
- # You can also set an individual fadein or fadeout to have a different number
- # of frames.
- # Set INITIAL_FRAMES to the number of frames it takes to fade in and out from
- # the beginning of the game at line 22.
- # Use these script calls to do the functions described next to them:
- # change_fade_time(n) - Change the number of frames it takes to fade in and
- # out to n.
- # fadein(n) - Fade the screen in with n frames.
- # fadeout(n) - Fade the screen out with n frames.
- # Keeping in mind that 60 frames = 1 second.
- #
- #===============================================================================
- #
- # BEGIN CONFIGURATION
- #
- module FADE_TIME # Do not touch this.
- INITIAL_FRAMES = 30 # Starting number of frames.
- end # Do not touch this.
- #
- # END CONFIGURATION
- #
- #===============================================================================
- #==============================================================================
- # ■ Game_System
- #------------------------------------------------------------------------------
- # システム周りのデータを扱うクラスです。セーブやメニューの禁止状態などを保存
- # します。このクラスのインスタンスは $game_system で参照されます。
- #==============================================================================
- class Game_System
- #--------------------------------------------------------------------------
- # Public Instance Variables
- #--------------------------------------------------------------------------
- attr_accessor :fade_time
- #--------------------------------------------------------------------------
- # Alias listing
- #--------------------------------------------------------------------------
- alias fade_init initialize
- #--------------------------------------------------------------------------
- # * Object Initialization
- #--------------------------------------------------------------------------
- def initialize(*args)
- fade_init(*args)
- @fade_time = FADE_TIME::INITIAL_FRAMES
- end
- end
- #==============================================================================
- # ■ Game_Interpreter
- #------------------------------------------------------------------------------
- # イベントコマンドを実行するインタプリタです。このクラスは Game_Map クラス、
- # Game_Troop クラス、Game_Event クラスの内部で使用されます。
- #==============================================================================
- class Game_Interpreter
- #--------------------------------------------------------------------------
- # * Fadeout screen
- #--------------------------------------------------------------------------
- def command_221
- Fiber.yield while $game_message.visible
- screen.start_fadeout($game_system.fade_time)
- wait($game_system.fade_time)
- end
- #--------------------------------------------------------------------------
- # * Fadein screen
- #--------------------------------------------------------------------------
- def command_222
- Fiber.yield while $game_message.visible
- screen.start_fadein($game_system.fade_time)
- wait($game_system.fade_time)
- end
- #--------------------------------------------------------------------------
- # * Alter fade time for screen
- # n : new number of frames fadein and fadeout take.
- #--------------------------------------------------------------------------
- def change_fade_time(n)
- $game_system.fade_time = n
- end
- #--------------------------------------------------------------------------
- # * Fadein with specific number of frames
- # n : number of frames to fade in by (defaults to set number)
- #--------------------------------------------------------------------------
- def fadein(n = $game_system.fade_time)
- Fiber.yield while $game_message.visible
- screen.start_fadein(n)
- wait(n)
- end
- #--------------------------------------------------------------------------
- # * Fadeout with specific number of frames
- # n : number of frames to fade in by (defaults to set number)
- #--------------------------------------------------------------------------
- def fadeout(n = $game_system.fade_time)
- Fiber.yield while $game_message.visible
- screen.start_fadeout(n)
- wait(n)
- end
- end
- $imported ||= {}
- $imported[:pac_change_fade_time]
- #===============================================================================
- #
- # END OF SCRIPT
- #
- #===============================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement