#------------------------------------------------------------------
# Press Start avant l'écran Titre RGSS3 (Rpg maker VX Ace)
#------------------------------------------------------------------
# De Blodangan
# Pour
https://rpg-maker-vx.bbactif.com/#------------------------------------------------------------------
module Blodangan
module Press_Start
# Quelle message afficher ?
Message_Press_Start = "Press Start"
# Afficher Le Titre du Jeu ? true = oui, false = non
Afficher_Titre_Jeu = true
# Nom de l'image du premier fond dans le dossier ...\Graphics\Titles1
Fond1 = "Night"
# Nom de l'image du deuxieme fond dans le dossier ...\Graphics\Titles2
# laissez vide pour ne pas avoir de fond n°2
Fond2 = ""
# Nom de la musique à jouer, dans le dossier ...\Audio\BGM
Musique_Press_Start = "Theme1"
end
end
#==============================================================================
# ■ module SceneManager
#==============================================================================
module SceneManager
#--------------------------------------------------------------------------
# ● 最初のシーンクラスを取得
#--------------------------------------------------------------------------
def self.first_scene_class
$BTEST ? Scene_Battle : Scene_Press_Start
end
end
#==============================================================================
# ■ Window_PressStartCommand
#==============================================================================
class Window_PressStartCommand < Window_Command
#--------------------------------------------------------------------------
# Initialize
#--------------------------------------------------------------------------
def initialize
super(0, 0)
update_placement
self.openness = 0
open
end
#--------------------------------------------------------------------------
# Window Width
#--------------------------------------------------------------------------
def window_width
return 160
end
#--------------------------------------------------------------------------
# Update Placement
#--------------------------------------------------------------------------
def update_placement
self.x = (Graphics.width - width) / 2
self.y = (Graphics.height * 1.6 - height) / 2
end
#--------------------------------------------------------------------------
# Maker Command List
#--------------------------------------------------------------------------
def make_command_list
add_command(Blodangan::Press_Start::Message_Press_Start, :press_start)
end
end
#==============================================================================
# ■ Scene_Press_Start
#==============================================================================
class Scene_Press_Start < Scene_Base
#--------------------------------------------------------------------------
# Start
#--------------------------------------------------------------------------
def start
super
SceneManager.clear
Graphics.freeze
create_fond
create_premier_plan
create_command_window
play_press_start_music
end
#--------------------------------------------------------------------------
# Transition
#--------------------------------------------------------------------------
def transition_speed
return 20
end
#--------------------------------------------------------------------------
# Terminate
#--------------------------------------------------------------------------
def terminate
super
SceneManager.snapshot_for_background
dispose_fond
dispose_premier_plan
end
#--------------------------------------------------------------------------
# Create Fond
#--------------------------------------------------------------------------
def create_fond
@fond1 = Sprite.new
@fond1.bitmap = Cache.title1(Blodangan::Press_Start::Fond1)
@fond2 = Sprite.new
@fond2.bitmap = Cache.title2(Blodangan::Press_Start::Fond2)
centrer_sprite(@fond1)
centrer_sprite(@fond2)
end
#--------------------------------------------------------------------------
# Create Premier Plan
#--------------------------------------------------------------------------
def create_premier_plan
@premier_plan = Sprite.new
@premier_plan.bitmap = Bitmap.new(Graphics.width, Graphics.height)
@premier_plan.z = 100
dessiner_titre_jeu if Blodangan::Press_Start::Afficher_Titre_Jeu
end
#--------------------------------------------------------------------------
# Dessiner Titre Jeu
#--------------------------------------------------------------------------
def dessiner_titre_jeu
@premier_plan.bitmap.font.size = 48
rect = Rect.new(0, 0, Graphics.width, Graphics.height / 2)
@premier_plan.bitmap.draw_text(rect, $data_system.game_title, 1)
end
#--------------------------------------------------------------------------
# Dispose Fond
#--------------------------------------------------------------------------
def dispose_fond
@fond1.bitmap.dispose
@fond1.dispose
@fond2.bitmap.dispose
@fond2.dispose
end
#--------------------------------------------------------------------------
# Dispose Premier Plan
#--------------------------------------------------------------------------
def dispose_premier_plan
@premier_plan.bitmap.dispose
@premier_plan.dispose
end
#--------------------------------------------------------------------------
# Centrer Sprite
#--------------------------------------------------------------------------
def centrer_sprite(sprite)
sprite.ox = sprite.bitmap.width / 2
sprite.oy = sprite.bitmap.height / 2
sprite.x = Graphics.width / 2
sprite.y = Graphics.height / 2
end
#--------------------------------------------------------------------------
# Create Command Window
#--------------------------------------------------------------------------
def create_command_window
@command_window = Window_PressStartCommand.new
@command_window.set_handler(:press_start, method(:command_press_start))
end
#--------------------------------------------------------------------------
# Close Command Window
#--------------------------------------------------------------------------
def close_command_window
@command_window.close
update until @command_window.close?
end
#--------------------------------------------------------------------------
# Command Press Start
#--------------------------------------------------------------------------
def command_press_start
close_command_window
SceneManager.call(Scene_Title)
end
#--------------------------------------------------------------------------
# Play Press Start Music
#--------------------------------------------------------------------------
def play_press_start_music
@musique = Blodangan::Press_Start::Musique_Press_Start
Audio.bgm_play("Audio/BGM/" + @musique, 100, 100, 0)
RPG::BGS.stop
RPG::ME.stop
end
end