Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #===============================================================================
- # Author: Wyn Wizard
- # Supporting Authors: Dekita
- # Email: [email protected]
- # Title: Wyn Engine Ace - Splash Scene
- # Creation Date: 2/16/2017
- # Version: 1.0
- #===============================================================================
- # KNOWN BUGS:
- # None
- #-------------------------------------------------------------------------------
- # WARNING:
- # This script does alias and overwrite some parts of the Scene_Title. Please be
- # aware that this can, and probably will, cause a conflict with any other
- # scripts that also change Scene_Title. Please use at your own caution.
- #-------------------------------------------------------------------------------
- # UPDATES:
- # 1.) Made this one stand alone. Core script no longer needed.
- #-------------------------------------------------------------------------------
- # INSTRUCTIONS:
- # 1.) This script must be placed below the DMEA Core Script in order for it to
- # run properly.
- # 2.) This script is fairy flexible, and the editable region is fairly easy to
- # follow.
- # The Scenes array is broken into a set of hashs that incude:
- # name of the picture file wanted to be shown, picture's "hang" on
- # the screen, and then its fade speeds. You can create more than one scene.
- # To do this, go to the last scene in the Splash_Settings module and add a
- # "," to it. Then insert this into a new line:
- # {:name => "file_name, :hang => frames, :fade => [fade_in, fade_out]}
- # - The file name is the name of the picture
- # - The frames tells the scene how long to hold the picture on the scene
- # [60 frames = 1 sec]
- # - The fade in speed controls the oppacity of the picture's incremement
- # speed which makes the picture appear on the screen.
- # - The fade out speed controls the oppacity of the picture's decremement
- # speed which makes the picture disappear from the screen
- #
- # If any errors occur, please feel free to email me at [email protected],
- # or pm me, Wyn Wizard.
- #-------------------------------------------------------------------------------
- # TERMS AND CONDITIONS:
- # 1.) You must credit Wyn Wizard and Dekita if you use this script or this
- # engine.
- # 2.) This script and engine is free for non comercial games.
- # 3.) This script and engine is not free for commercial games. If you want to
- # use this engine in a comercial game, pm me since i am the main code
- # master.
- # 4.) Do not claim this script as your own. I know my coding style, and I will
- # persue legal actions.
- #===============================================================================
- # Version: At the moment, this is not needed. May be needed in future releases.
- ($imported||={})[:Wyn_Splash] = 1.1
- #===============================================================================
- # ■ EDITABLE REGION
- #===============================================================================
- module WEA
- module Splash_Settings
- Scenes = [
- # [name of picture, how long the picture stays]
- {:name => "studio_logo", :hang => 60},
- #{:name => "dekita_studio_logo", :hang => 60}
- ]
- Fade_in_speed = 2
- Fade_out_speed = 4
- Sounds = {
- :title => ["Audio/BGM/" + "Theme5", 80, 100]
- }
- #---------------------------------------------------------------------------
- # ■ Play BGM
- #---------------------------------------------------------------------------
- def self.play_bgm(key)
- Audio.bgm_play(*Sounds[key])
- end
- end
- end
- #===============================================================================
- # DO NOT EDIT BELOW HERE!
- # EDITING BELOW HERE MAY RESULT IN, BUT NOT RESTRICTED TO: NAUSEA, VOMITING,
- # EXPLOSIVE DIARRHEA, IMPLOSIVE DIARRHEA, DEMINSIA, LOSS OF: VISION, HEARING,
- # FEELING IN YOUR LEFT LEG, OR HAIR.
- #===============================================================================
- # ** SceneManager
- #-----------------------------------------------------------------------------
- # This module manages scene transitions. For example, it can handle
- # hierarchical structures such as calling the item screen from the main menu
- # or returning from the item screen to the main menu.
- #------------------------------------------------------------------------------
- # Functions Overwritten: 1
- # Functions Aliased: 0
- #=============================================================================
- class << SceneManager
- #---------------------------------------------------------------------------
- # * Get First Scene Class
- #---------------------------------------------------------------------------
- def first_scene_class
- $BTEST ? Scene_Battle : Scene_Splash
- end
- end
- #=============================================================================
- # ** Splash Scene
- #-----------------------------------------------------------------------------
- # This class holds the fucntionality that runs the splash scene before the
- # screen runs.
- #=============================================================================
- class Scene_Splash < Scene_Base
- #---------------------------------------------------------------------------
- # ■ Start Method
- #---------------------------------------------------------------------------
- def start
- super
- # WEA::Splash_Settings::play_bgm(:title)
- @sprite = Sprite.new(@viewport)
- @splash_scenes = WEA::Splash_Settings::Scenes.compact()
- @splash_scene_id = 0
- @fade_in_speed = WEA::Splash_Settings::Fade_in_speed
- @fade_out_speed = WEA::Splash_Settings::Fade_out_speed
- reset_splash()
- end
- #---------------------------------------------------------------------------
- # ■ Reset Splash Scene Method
- #---------------------------------------------------------------------------
- def reset_splash
- data = @splash_scenes[@splash_scene_id]
- return unless data
- @stage = :fade_in
- @stage_opacity = 0
- @mid_hang = data[:hang]
- @sprite.bitmap = Cache.picture(data[:name])
- @sprite.opacity = @stage_opacity
- @sprite_center_x = Graphics.width/2 - (@sprite.width/2)
- @sprite_center_y = Graphics.height/2 - (@sprite.height/2)
- @sprite.x = @sprite_center_x
- @sprite.y = @sprite_center_y
- @sprite.zoom_x = (@sprite.zoom_y = 1.0)
- end
- #---------------------------------------------------------------------------
- # ■ Update Method
- #---------------------------------------------------------------------------
- def update
- super
- case @stage
- when :fade_in then @stage_opacity += @fade_in_speed
- @stage = :fade_mid if @stage_opacity >= 255
- when :fade_mid then @mid_hang -= 1
- @stage = :fade_out if @mid_hang <= 0
- when :fade_out then @stage_opacity -= @fade_out_speed
- @sprite.zoom_x = (@sprite.zoom_y -= 0.001)
- @sprite_center_x = Graphics.width/2 - ((@sprite.width * @sprite.zoom_x)/2)
- @sprite_center_y = Graphics.height/2 - ((@sprite.height * @sprite.zoom_y)/2)
- @sprite.x = @sprite_center_x
- @sprite.y = @sprite_center_y
- @stage = :end if @stage_opacity <= 0
- when :end then update_stage_id()
- end
- @sprite.opacity = @stage_opacity
- end
- #---------------------------------------------------------------------------
- # ■ Update Stage ID Method
- #---------------------------------------------------------------------------
- def update_stage_id
- if (@splash_scene_id == @splash_scenes.size())
- SceneManager.call(Scene_Title)
- else
- @splash_scene_id += 1
- reset_splash()
- end
- end
- end
- #==============================================================================
- # ** Scene_Title
- #------------------------------------------------------------------------------
- # This class performs the title screen processing.
- #------------------------------------------------------------------------------
- # Functions Overwritten: 1
- # Functions Aliased: 14
- #==============================================================================
- class Scene_Title < Scene_Base
- #--------------------------------------------------------------------------
- # * Start Processing
- #--------------------------------------------------------------------------
- alias :wea_splash_title_start start
- def start
- wea_splash_title_start()
- end
- #--------------------------------------------------------------------------
- # * Get Transition Speed
- #--------------------------------------------------------------------------
- alias :wea_splash_title_speed transition_speed
- def transition_speed
- wea_splash_title_speed()
- end
- #--------------------------------------------------------------------------
- # * Termination Processing
- #--------------------------------------------------------------------------
- alias :wea_splash_title_terminate terminate
- def terminate
- wea_splash_title_terminate()
- end
- #--------------------------------------------------------------------------
- # * Create Background
- #--------------------------------------------------------------------------
- alias :wea_splash_title_createBackground create_background
- def create_background
- wea_splash_title_createBackground()
- end
- #--------------------------------------------------------------------------
- # * Create Foreground
- #--------------------------------------------------------------------------
- alias :wea_splash_title_createForeground create_foreground
- def create_foreground
- wea_splash_title_createForeground()
- end
- #--------------------------------------------------------------------------
- # * Draw Game Title
- #--------------------------------------------------------------------------
- alias :wea_splash_title_drawGameTitle draw_game_title
- def draw_game_title
- wea_splash_title_drawGameTitle
- end
- #--------------------------------------------------------------------------
- # * Free Background
- #--------------------------------------------------------------------------
- alias :wea_splash_title_disposeBackground dispose_background
- def dispose_background
- wea_splash_title_disposeBackground()
- end
- #--------------------------------------------------------------------------
- # * Free Foreground
- #--------------------------------------------------------------------------
- alias :wea_splash_title_disposeForeground dispose_foreground
- def dispose_foreground
- wea_splash_title_disposeForeground()
- end
- #--------------------------------------------------------------------------
- # * Move Sprite to Screen Center
- #--------------------------------------------------------------------------
- alias :wea_splash_title_centerSprite center_sprite
- def center_sprite(sprite)
- wea_splash_title_centerSprite(sprite)
- end
- #--------------------------------------------------------------------------
- # * Create Command Window
- #--------------------------------------------------------------------------
- alias :wea_splash_title_createCMDWin create_command_window
- def create_command_window
- wea_splash_title_createCMDWin()
- end
- #--------------------------------------------------------------------------
- # * Close Command Window
- #--------------------------------------------------------------------------
- alias :wea_splash_title_closeCMDWin close_command_window
- def close_command_window
- wea_splash_title_closeCMDWin()
- end
- #--------------------------------------------------------------------------
- # * [New Game] Command
- #--------------------------------------------------------------------------
- alias :wea_splash_title_newGameCMD command_new_game
- def command_new_game
- wea_splash_title_newGameCMD()
- end
- #--------------------------------------------------------------------------
- # * [Continue] Command
- #--------------------------------------------------------------------------
- alias :wea_splash_title_continueCMD command_continue
- def command_continue
- wea_splash_title_continueCMD()
- end
- #--------------------------------------------------------------------------
- # * [Shut Down] Command
- #--------------------------------------------------------------------------
- alias :wea_splash_title_shutdownCMD command_shutdown
- def command_shutdown
- wea_splash_title_shutdownCMD()
- end
- #--------------------------------------------------------------------------
- # * Play Title Screen Music
- #--------------------------------------------------------------------------
- def play_title_music
- # Overwritten method to allow the music from the splash screen to continue.
- end
- end #end script
- #==============================================================================#
- # ** Script created by Wyn Wizard ** #
- #==============================================================================#
Advertisement
Add Comment
Please, Sign In to add comment