Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %Q(
- ╔════╦═══╦═══╦═══╦═══╦═══╦═══╦═══╦═══╦═══╦═══╦═══╦═══╦═══╦═══╦═══╦═══╦═══╦═════╗
- ║ ╔══╩═══╩═══╩═══╩═══╩═══╩═══╩═══╩═══╩═══╩═══╩═══╩═══╩═══╩═══╩═══╩═══╩═══╩═══╗ ║
- ╠─╣ Split Transitions ╠─╣
- ╠─╣ by RPG Maker Source. ╠─╣
- ╠─╣ www.rpgmakersource.com ╠─╣
- ║ ╚══╦═══╦═══╦═══╦═══╦═══╦═══╦═══╦═══╦═══╦═══╦═══╦═══╦═══╦═══╦═══╦═══╦═══╦═══╝ ║
- ╠════╩═╤═╩═╤═╩═╤═╩═╤═╩═╤═╩═╤═╩═╤═╩═╤═╩═╤═╩═╤═╩═╤═╩═╤═╩═╤═╩═╤═╩═╤═╩═╤═╩═╤═╩═════╣
- ║ ┌────┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴─────┐ ║
- ╠─┤ Version 1.0.0 24/11/14 DD/MM/YY ├─╣
- ║ └────┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┘ ║
- ╠══════╧═══╧═══╧═══╧═══╧═══╧═══╧═══╧═══╧═══╧═══╧═══╧═══╧═══╧═══╧═══╧═══╧═══════╣
- ║ ║
- ║ This work is protected by the following license: ║
- ║ ╔══════════════════════════════════════════════════════════════════╗ ║
- ║ │ │ ║
- ║ │ Copyright © 2014 Maker Systems. │ ║
- ║ │ │ ║
- ║ │ This software is provided 'as-is', without any kind of │ ║
- ║ │ warranty. Under no circumstances will the author be held │ ║
- ║ │ liable for any damages arising from the use of this software. │ ║
- ║ │ │ ║
- ║ │ Permission is granted to anyone to use this software on their │ ║
- ║ │ free or commercial games made with a legal copy of RPG Maker │ ║
- ║ │ VX Ace, as long as Maker Systems - RPG Maker Source is │ ║
- ║ │ credited within the game. │ ║
- ║ │ │ ║
- ║ │ Selling this code or any portions of it 'as-is' or as part of │ ║
- ║ │ another code, is not allowed. │ ║
- ║ │ │ ║
- ║ │ The original header, which includes this copyright notice, │ ║
- ║ │ must not be edited or removed from any verbatim copy of the │ ║
- ║ │ sotware nor from any edited version. │ ║
- ║ │ │ ║
- ║ ╚══════════════════════════════════════════════════════════════════╝ ║
- ║ ║
- ║ ║
- ╠══════════════════════════════════════════════════════════════════════════════╣
- ║ 1. VERSION HISTORY. ▼ ║
- ╠══════════════════════════════════════════════════════════════════════════════╣
- ║ ║
- ║ • Version 1.0.0, 24/11/14 - (DD/MM/YY). ║
- ║ ║
- ╠══════════════════════════════════════════════════════════════════════════════╣
- ╠══════════════════════════════════════════════════════════════════════════════╣
- ║ 2. USER MANUAL. ▼ ║
- ╠══════════════════════════════════════════════════════════════════════════════╣
- ║ ║
- ║ ┌──────────────────────────────────────────────────────────────────────────┐ ║
- ║ │ ■ Introduction. │ ║
- ║ └┬┬┬┬──────────────────────────────────────────────────────────────────┬┬┬┬┘ ║
- ║ ║
- ║ Hello there! This script is "plug and play", you can simply insert it into ║
- ║ your project and it will perform flawlessly. ║
- ║ ║
- ║ This script makes a nifty transition effect between every Scene of your ║
- ║ game. ║
- ║ The effect will be performed whenever a Scene changes, for example, when ║
- ║ you enter the menu from the map, or when you enter the inventory screen, ║
- ║ when you go back to the menu, when you go back to the map, and so on. ║
- ║ ║
- ║ This is a great addition to make your game look more polished, since the ║
- ║ default way RPG Maker Ace handles scene transitions (except for battle ║
- ║ ones) is to just make the new Scene violently appear in the screen. ║
- ║ ║
- ║ Works with custom menu scripts or custom scenes too. ║
- ║ ║
- ║ We hope you enjoy it. ║
- ║ ║
- ║ Thanks for choosing our products. ║
- ║ ║
- ║ ┌──────────────────────────────────────────────────────────────────────────┐ ║
- ║ │ ■ Configuration. │ ║
- ║ └┬┬┬┬──────────────────────────────────────────────────────────────────┬┬┬┬┘ ║
- ║ ║
- ║ "How do I change the speed of the effect?" ║
- ║ Right click anywhere in the script editor and select "Find" (or CTRL + F), ║
- ║ search for "SPEED" (without quotation marks). ║
- ║ ║
- ║ You will see something like "SPEED = 16" ║
- ║ ║
- ║ Set the number after the equality sign to any numer you like, bigger or ║
- ║ equal than 1. The bigger the number, the faster the effect is performed. ║
- ║ Small numbers result in a slower transition, default value is 16. ║
- ║ ║
- ║ "How do I exclude some Scenes from the effect?" ║
- ║ Right click anywhere in the script editor and select "Find" (or CTRL + F), ║
- ║ searh for "EXCLUDE" (without quotation marks). ║
- ║ ║
- ║ You will see something like "EXCLUDE = 'Scene_Title Scene_Battle'" ║
- ║ ║
- ║ To exclude more Scenes from the effect, simply add their names between ║
- ║ those single quotes. ║
- ║ For example, to exclude the Shop Scene too: ║
- ║ ║
- ║ EXCLUDE = 'Scene_Title Scene_Battle Scene_Shop' ║
- ║ ║
- ║ ║
- ╠══════════════════════════════════════════════════════════════════════════════╣
- ╠══════════════════════════════════════════════════════════════════════════════╣
- ║ 3. NOTES. ▼ ║
- ╠══════════════════════════════════════════════════════════════════════════════╣
- ║ ║
- ║ Have fun and enjoy! ║
- ║ ║
- ╠══════════════════════════════════════════════════════════════════════════════╣
- ╠══════════════════════════════════════════════════════════════════════════════╣
- ║ 4. CONTACT. ▼ ║
- ╠══════════════════════════════════════════════════════════════════════════════╣
- ║ ║
- ║ Keep in touch with us and be the first to know about new releases: ║
- ║ ║
- ║ www.rpgmakersource.com ║
- ║ www.facebook.com/RPGMakerSource ║
- ║ www.twitter.com/RPGMakerSource ║
- ║ www.youtube.com/user/RPGMakerSource ║
- ║ ║
- ║ Get involved! Have an idea for a system? Let us know. ║
- ║ ║
- ║ Spread the word and help us reach more people so we can continue creating ║
- ║ awesome resources for you! ║
- ║ ║
- ╚══════════════════════════════════════════════════════════════════════════════╝)
- #==============================================================================
- # ** MakerSystems [NEW]
- #------------------------------------------------------------------------------
- # Module for our Systems.
- #==============================================================================
- module MakerSystems
- #============================================================================
- # ** Split Transitions [NEW]
- #----------------------------------------------------------------------------
- # This module contains some configurable parameters.
- #============================================================================
- module SplitTransitions
- #------------------------------------------------------------------------
- # * Scenes to EXCLUDE. [OPT]
- #------------------------------------------------------------------------
- EXCLUDE = 'Scene_Title Scene_Battle'
- #------------------------------------------------------------------------
- # * SPEED of the stripe's movement. [OPT]
- #------------------------------------------------------------------------
- SPEED = 16
- end
- end
- #==============================================================================
- # ** Scene_Base [MOD]
- #------------------------------------------------------------------------------
- # This is a super class of all scenes within the game.
- #==============================================================================
- class Scene_Base
- # This will hold the screen's Bitmap.
- @@_ms_split_transitions_screen = nil
- # This holds the current mode.
- @@_ms_split_transitions_switch = 0
- #--------------------------------------------------------------------------
- # * Alias Pre Terminate. [NEW]
- #--------------------------------------------------------------------------
- alias_method(:ms_split_transitions_original_pre_terminate, :pre_terminate)
- #--------------------------------------------------------------------------
- # * Pre Terminate. [MOD]
- #--------------------------------------------------------------------------
- def pre_terminate
- # Prepares Split Transition unless origin or target are to be excluded.
- exclude = MakerSystems::SplitTransitions::EXCLUDE
- unless exclude =~ /#{SceneManager.scene.class.name}/ ||
- exclude =~ /#{@ms_split_transitions_origin_scene}/
- @@_ms_split_transitions_screen = Graphics.snap_to_bitmap
- end
- # Original method.
- ms_split_transitions_original_pre_terminate
- end
- #--------------------------------------------------------------------------
- # * Alias Post Start. [NEW]
- #--------------------------------------------------------------------------
- alias_method(:ms_split_transitions_original_post_start, :post_start)
- #--------------------------------------------------------------------------
- # * Post Start. [MOD]
- #--------------------------------------------------------------------------
- def post_start
- # If Split Transition was prepared.
- if @@_ms_split_transitions_screen
- # Vertical Opening.
- if @@_ms_split_transitions_switch == 1
- # Calculates stripe size.
- stripe_width = @@_ms_split_transitions_screen.width
- stripe_height = @@_ms_split_transitions_screen.height / 2
- # SPEED. Only Y axis will move.
- plus_x = 0
- plus_y = MakerSystems::SplitTransitions::SPEED
- # Origin position for both stripes.
- x1 = 0
- y1 = 0
- x2 = 0
- y2 = stripe_height
- # Target position.
- tx = 0
- ty = Graphics.height
- # Switches transition mode.
- @@_ms_split_transitions_switch = 0
- # Horizontal Opening.
- else
- # Calculates stripe size.
- stripe_width = @@_ms_split_transitions_screen.width / 2
- stripe_height = @@_ms_split_transitions_screen.height
- # SPEED. Only X axis will move.
- plus_x = MakerSystems::SplitTransitions::SPEED
- plus_y = 0
- # Origin position for both stripes.
- x1 = 0
- y1 = 0
- x2 = stripe_width
- y2 = 0
- # Target position.
- tx = Graphics.width
- ty = 0
- # Switches transition mode.
- @@_ms_split_transitions_switch = 1
- end
- # Creates first stripe Sprite in the correct position.
- sprite_1 = Sprite.new
- sprite_1.x = x1
- sprite_1.y = y1
- sprite_1.z = 99999999
- # Sets Bitmap for the stripe, drawn from the correct screen position.
- rect_1 = Rect.new(x1, y1, stripe_width, stripe_height)
- sprite_1.bitmap = Bitmap.new(stripe_width, stripe_height)
- sprite_1.bitmap.blt(0, 0, @@_ms_split_transitions_screen, rect_1)
- # Creates second stripe Sprite in the correct position.
- sprite_2 = Sprite.new
- sprite_2.x = x2
- sprite_2.y = y2
- sprite_2.z = 99999999
- # Sets Bitmap for the stripe, drawn from the correct screen position.
- rect_2 = Rect.new(x2, y2, stripe_width, stripe_height)
- sprite_2.bitmap = Bitmap.new(stripe_width, stripe_height)
- sprite_2.bitmap.blt(0, 0, @@_ms_split_transitions_screen, rect_2)
- # Time to make the stripes visible.
- Graphics.transition(0)
- # Moves until target position is reached.
- while (sprite_2.x <= tx && sprite_2.y <= ty)
- sprite_1.x -= plus_x
- sprite_2.x += plus_x
- sprite_1.y -= plus_y
- sprite_2.y += plus_y
- # Everyone wants to see the movement.
- Graphics.update
- end
- # Dispose Bitmaps and Sprites once they leave the screen.
- sprite_1.bitmap.dispose
- sprite_1.dispose
- sprite_2.bitmap.dispose
- sprite_2.dispose
- # Frees the screen container.
- @@_ms_split_transitions_screen.dispose
- @@_ms_split_transitions_screen = nil
- end
- # Records the current Scene name.
- @ms_split_transitions_origin_scene = SceneManager.scene.class.name
- # Original method.
- ms_split_transitions_original_post_start
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement