The scrip I'm using:
Spoiler
#==============================================================================
# +++ MOG - Animated Title A (v2.4) +++
#==============================================================================
# By Moghunter
# https://atelierrgss.wordpress.com/
#==============================================================================
# Tela de titulo animado, com logo, imagens aleatórias e outros efeitos visuais.
#==============================================================================
#==============================================================================
# IMAGENS NECESSÁRIAS
#==============================================================================
# Serão necessários as seguintes imagens na pasta Graphics/Titles2/
#
# Cursor.png
# Commmand_Name.png (image filename = name of command)
# Particle.png (Opcional)
# Logo.jpg (Opcional)
# Animated.png (Opcional)
#==============================================================================
#==============================================================================
# NOTA 1 - Para definir a imagem de texto basta selecionar no banco de dados
# a imagem do titulo numero 2 (Segunda camada)
#==============================================================================
#==============================================================================
# NOTA 2 - O nome da imagem de comando é iguál ao nome do comando definido
# no banco de dados do Rpg Maker.
#==============================================================================
#==============================================================================
# ● Histórico (Version History)
#==============================================================================
# v 2.4 - Compatibilidade com resoluções acima do padrão.
# v 2.3 - O nome do comando não é mais baseado no database.
#==============================================================================
module MOG_SCENE_TITLE_A
#--------------------------------------------------------------------------
# ▼ LOGO ▼
#--------------------------------------------------------------------------
# Apresenta um Logo ao começar a tela de titulo.
# Será necessário ter a imagem LOGO.jpg (png) na pasta Graphics/Title2
#--------------------------------------------------------------------------
# Ativar Logo
LOGO = false
# Duração do logo.
LOGO_DURATION = nil #(Sec)
#--------------------------------------------------------------------------
# ▼ RANDOM BACKGROUND ▼
#--------------------------------------------------------------------------
#Definição das pictures.
#--------------------------------------------------------------------------
RANDOM_PICTURES = ["portada"]
#"portada", "Title0", "Title0"
#"Title4","Title5","Title6","Title7"
# ]
#Tempo de duração para ativar a troca de imagens.
RANDOM_PICTURES_DURATION = 999999 #(sec)
#Seleção aleatória.
RAMDOM_SELECTION = false
#Velocidade de Scrolling. (Speed X , Speed Y)
RANDOM_PICTURES_SCROLL_SPEED = [0,0]
#--------------------------------------------------------------------------
# ▼ MULTIPLE LAYERS ▼
#--------------------------------------------------------------------------
# Definição de multiplas camadas. * (não há limíte na quantidade de camadas
# usadas)
#--------------------------------------------------------------------------
# MULTIPLE_LAYERS = [ ["A",B,C,D], ["A",B,C,D], ["A",B,C D], ["A",B,C,D ], ....]
#
# A - Nome da imagem.
# B - Velocidade de scroll na horizontal.
# C - Velocidade de scroll na vertical.
# D - Tipo de Blend. (0 - Normal / 2 - Add / 3 - Substract)
#--------------------------------------------------------------------------
# ▼ PARTICLES ▼
#--------------------------------------------------------------------------
# Adiciona partículas animadas na tela do titulo.
# Será necessário ter a imagem PARTICLE.png na pasta Graphics/Title2
#--------------------------------------------------------------------------
# Ativar Partículas.
PARTICLE = true
# Ativar Cores Aleatórias.
PARTICLE_RANDOM_COLOR = false
# Definição do tipo de blend. (0,1,2)
PARTICLE_BLEND_TYPE = 1
#Definição do limite de velocidade das partículas.
PARTICLE_MOVEMENT_RANGE_X = 3
PARTICLE_MOVEMENT_RANGE_Y = 3
PARTICLE_ANGLE_RANGE = 3
#--------------------------------------------------------------------------
# ▼ WAVE TITLE ▼
#--------------------------------------------------------------------------
# Ativa o efeito WAVE no texto do titulo, o Texto do titulo é definido
# na camada do titulo 2, que pode ser definido através do banco de dados
#--------------------------------------------------------------------------
#Ativar o efeito do titulo com efeito WAVE.
TITLE_WAVE = false
#Configuração do efeito WAVE
#
# TITLE_WAVE_CONFIG = [ AMP, LENGTH , SPEED]
#
TITLE_WAVE_CONFIG = [6, 232, 360]
#--------------------------------------------------------------------------
# ▼ COMMANDS / SELECTION ▼
#--------------------------------------------------------------------------
# Configuração extras da tela de titulo.
#--------------------------------------------------------------------------
# Posição do comando.
COMMANDS_POS = [360, 220]
# Ativar o efeito de tremor ao selecionar o comando.
COMMAND_SHAKE = true
end
#==============================================================================
# ■ Window TitleCommand
#==============================================================================
class Window_TitleCommand < Window_Command
attr_reader :list
end
#==============================================================================
# ■ Particle Title
#==============================================================================
class Particle_Title < Sprite
include MOG_SCENE_TITLE_A
#--------------------------------------------------------------------------
# ● Initialize
#--------------------------------------------------------------------------
def initialize(viewport = nil)
super(viewport)
self.bitmap = Cache.title2("Particle2")
self.tone.set(rand(255),rand(255), rand(255), 255) if PARTICLE_RANDOM_COLOR
self.blend_type = PARTICLE_BLEND_TYPE
self.z = 50
@sc_x = [self.bitmap.width / 2, self.bitmap.width, Graphics.width ]
@sc_y = [self.bitmap.height / 2, self.bitmap.height, Graphics.height ]
@cw0 = self.bitmap.width / 2 ; @ch0 = self.bitmap.height / 2
@cw = self.bitmap.width + @cw0 ; @cw2 = Graphics.width
@ch = self.bitmap.height + @ch0 ; @ch2 = Graphics.height
@nx = PARTICLE_MOVEMENT_RANGE_X
@ny = PARTICLE_MOVEMENT_RANGE_Y
reset_setting
end
#--------------------------------------------------------------------------
# ● Reset Setting
#--------------------------------------------------------------------------
def reset_setting
zoom = (50 + rand(150)) / 150.1
self.zoom_x = zoom
self.zoom_y = zoom
self.x = rand(640)
self.y = rand(480 + self.bitmap.height)
self.opacity = 0
self.angle = rand(360)
self.blend_type = 1
@speed_x = 0
@speed_y = [[rand(-10), 0].min, 1].max
@speed_a = rand(2)
end
#--------------------------------------------------------------------------
# ● Dispose
#--------------------------------------------------------------------------
def dispose
super
self.bitmap.dispose
end
#--------------------------------------------------------------------------
# ● Update
#--------------------------------------------------------------------------
def update
super
self.x += @speed_x
self.y -= @speed_y
self.angle += @speed_a
self.opacity += 5
reset_setting if can_reset_setting?
end
#--------------------------------------------------------------------------
# ● Can Reset Setting
#--------------------------------------------------------------------------
def can_reset_setting?
return true if (self.x < -(@cw * 2) or self.x > (@cw2 + @cw))
return true if (self.y < -(@ch * 2) or self.y > (@ch2 + @ch))
return false
end
end
#==============================================================================
# ■ Multiple Layers Title
#==============================================================================
class Multiple_Layers_Title
#--------------------------------------------------------------------------
# ● Initialize
#--------------------------------------------------------------------------
def initialize(name = "", scroll_x = 0, scroll_y = 0, blend = 0, index = 0)
@layer = Plane.new
@layer.bitmap = Cache.title1(name.to_s) rescue nil
@layer.bitmap = Bitmap.new(32,32) if @layer.bitmap == nil
@layer.z = 10 + index
@layer.opacity = 0
@layer.blend_type = blend
@scroll_speed = [scroll_x, scroll_y]
end
#--------------------------------------------------------------------------
# ● Dispose
#--------------------------------------------------------------------------
def dispose
@layer.bitmap.dispose
@layer.bitmap = nil
@layer.dispose
end
#--------------------------------------------------------------------------
# ● Update
#--------------------------------------------------------------------------
def update
@layer.opacity += 2
@layer.ox += @scroll_speed[0]
@layer.oy += @scroll_speed[1]
end
end
#==============================================================================
# ■ Scene Title
#==============================================================================
class Scene_Title < Scene_Base
include MOG_SCENE_TITLE_A
#--------------------------------------------------------------------------
# ● Start
#--------------------------------------------------------------------------
def start
super
#RPG::BGM.fade(2000)
@logo_active = LOGO
SceneManager.clear
@phase = 1
@phase_time = -1
dispose_title_sprites
create_logo if @logo_active
create_command_window
create_commands
create_background
create_light
play_title_music
end
#--------------------------------------------------------------------------
# ● Create_Logo
#--------------------------------------------------------------------------
def create_logo
@phase = 0
@logo = Sprite.new
@logo.bitmap = Cache.title2("Logo")
@logo.opacity = 0
@logo_duration = 180 + (LOGO_DURATION * 60)
@logo.z = 200
end
#--------------------------------------------------------------------------
# ● Create Commands
#--------------------------------------------------------------------------
def create_commands
@command_window.visible = false
@commands_index_old = -1
@commands = []
@commands_shake_duration = 10
index = 0
for com in 0...3
sprite = Sprite.new
case index
when 0; com_name = "Adentrarse"
when 1; com_name = "Correr"
when 2; com_name = "Escapar"
#when 3; com_name = "Escapar"
end
sprite.bitmap = Cache.title2(com_name.to_s) rescue nil
if sprite.bitmap == nil
sprite.bitmap = Bitmap.new(200,32)
Font.default_name = ["Century"]
sprite.bitmap.font.size = 24
sprite.bitmap.font.bold = true
sprite.bitmap.font.italic = true
sprite.bitmap.draw_text(0, 0, 200, 32, com_name.to_s,1)
end
sprite.x = COMMANDS_POS[0] - 100 - (index * 20)
sprite.y = index * sprite.bitmap.height + COMMANDS_POS[1]
sprite.z = 100 + index
sprite.opacity = 0
index += 1
@commands.push(sprite)
end
@command_max = index
end
#--------------------------------------------------------------------------
# ● create_background
#--------------------------------------------------------------------------
def create_background
@rand_title_duration = 9999999
@old_back_index = 0
@sprite1 = Plane.new
@sprite1.opacity = 0
@sprite1.z = 1
if RAMDOM_SELECTION
execute_random_picture(false)
else
execute_random_picture(false)
end
@sprite2 = Sprite.new
@sprite2.bitmap = Cache.title2($data_system.title2_name)
@sprite2.z = 100
@sprite2.opacity = 0
if TITLE_WAVE
@sprite2.wave_amp = TITLE_WAVE_CONFIG[0]
@sprite2.wave_length = TITLE_WAVE_CONFIG[1]
@sprite2.wave_speed = TITLE_WAVE_CONFIG[2]
end
end
#--------------------------------------------------------------------------
# ● Create Light
#--------------------------------------------------------------------------
def create_light
return unless PARTICLE
@light_bitmap =[]
for i in 0...25
@light_bitmap.push(Particle_Title.new(nil))
end
end
#--------------------------------------------------------------------------
# ● dispose Background1
#--------------------------------------------------------------------------
def dispose_background1
@sprite1.bitmap.dispose
@sprite1.bitmap = nil
@sprite1.dispose
@sprite1 = nil
end
#--------------------------------------------------------------------------
# ● Dispose Background2
#--------------------------------------------------------------------------
def dispose_background2
if @sprite2.bitmap != nil
@sprite2.bitmap.dispose
@sprite2.bitmap = nil
@sprite2.dispose
@sprite2 = nil
end
end
#--------------------------------------------------------------------------
# ● Dispose Light
#--------------------------------------------------------------------------
def dispose_light
return unless PARTICLE
if @light_bitmap != nil
for i in @light_bitmap
i.dispose
end
@light_bitmap = nil
end
end
#--------------------------------------------------------------------------
# ● Dispose Logo
#--------------------------------------------------------------------------
def dispose_logo
return unless @logo_active
@logo.bitmap.dispose
@logo.dispose
end
#--------------------------------------------------------------------------
# ● Dispose Multiple Layers
#--------------------------------------------------------------------------
def dispose_multiple_layers
return if @m_layers == nil
@m_layers.each {|layer| layer.dispose }
end
#--------------------------------------------------------------------------
# ● Terminate
#--------------------------------------------------------------------------
def terminate
super
dispose_title_sprites
end
#--------------------------------------------------------------------------
# ● Dispose Title Sprites
#--------------------------------------------------------------------------
def dispose_title_sprites
return if @cursor == nil
dispose_background1
dispose_background2
dispose_light
dispose_logo
for com in @commands
com.bitmap.dispose
com.dispose
end
end
#--------------------------------------------------------------------------
# ● Update
#--------------------------------------------------------------------------
def update
super
update_logo
update_initial_animation
update_command
update_background
update_light
end
#--------------------------------------------------------------------------
# ● Make Object bitmap
#--------------------------------------------------------------------------
def make_object_bitmap
@object.bitmap.clear
src_rect_back = Rect.new(@object_width * @object_index, 0,@object_width,@object_image.height)
@object.bitmap.blt(0,0, @object_image, src_rect_back)
end
#--------------------------------------------------------------------------
# ● Update Logo
#--------------------------------------------------------------------------
def update_logo
return if @phase != 0
loop do
break if @logo_duration == 0
execute_logo
Graphics.update
Input.update
end
play_title_music
end
#--------------------------------------------------------------------------
# ● Execute Logo
#--------------------------------------------------------------------------
def execute_logo
if @logo_duration > 120 and (Input.trigger?:)C) or Input.trigger?:)B))
@logo_duration = 120
end
@logo_duration -= 1
if @logo_duration > 120
@logo.opacity += 5
else
@logo.opacity -= 5
end
if @logo.opacity <= 0
@logo_duration = 0
@phase = 1
end
end
#--------------------------------------------------------------------------
# ● Update Background
#--------------------------------------------------------------------------
def update_background
@sprite1.ox += RANDOM_PICTURES_SCROLL_SPEED[0]
@sprite1.oy += RANDOM_PICTURES_SCROLL_SPEED[1]
@sprite2.opacity += 2
@sprite2.update
return if RANDOM_PICTURES.size < 1
@rand_title_duration -= 1
if @rand_title_duration <= 0
@sprite1.opacity -= 5 unless RANDOM_PICTURES.size < 2
else
@sprite1.opacity += 5
end
return if @sprite1.opacity != 0
execute_random_picture
end
#--------------------------------------------------------------------------
# ● Execute Random Picture
#--------------------------------------------------------------------------
def execute_random_picture(initial = false)
@rand_title_duration = [[60 * RANDOM_PICTURES_DURATION, 9999].min, 60].max
if @sprite1.bitmap != nil
@sprite1.bitmap.dispose
@sprite1.bitmap = nil
end
if RAMDOM_SELECTION
rand_pic = rand(RANDOM_PICTURES.size)
if rand_pic == @old_back_index
rand_pic += 1
rand_pic = 0 if rand_pic >= RANDOM_PICTURES.size
end
@old_back_index = rand_pic
else
@old_back_index += 1 unless initial
@old_back_index = 0 if @old_back_index >= RANDOM_PICTURES.size
end
pic = RANDOM_PICTURES[@old_back_index]
@sprite1.bitmap = Cache.title1(pic) rescue nil
@sprite1.bitmap = Cache.title1("") if @sprite1.bitmap == nil
end
#--------------------------------------------------------------------------
# ● Update Light
#--------------------------------------------------------------------------
def update_light
return unless PARTICLE
if @light_bitmap != nil
for i in @light_bitmap
i.update
end
end
end
#--------------------------------------------------------------------------
# ● Update Initial Animation
#--------------------------------------------------------------------------
def update_initial_animation
return if @phase != 1
@phase_time -= 1 if @phase_time > 0
if @phase_time == 0
@phase = 2
@phase_time = 30
end
for i in @commands
index = 0
if i.x < COMMANDS_POS[0]
i.x += 5 + (2 * index)
i.opacity += 10
if i.x >= COMMANDS_POS[0]
i.x = COMMANDS_POS[0]
i.opacity = 255
if @phase_time < 15 / 2
@phase_time = 15
end
end
end
index += 1
end
end
#--------------------------------------------------------------------------
# * Play Title Screen Music
#--------------------------------------------------------------------------
def play_title_music
$data_system.title_bgm.play
RPG::BGS.stop
RPG::ME.stop
end
#--------------------------------------------------------------------------
# ● Update Command
#--------------------------------------------------------------------------
def update_command
return if @phase != 2
update_command_slide
end
#--------------------------------------------------------------------------
# ● Update Command Slide
#--------------------------------------------------------------------------
def update_command_slide
if @commands_index_old != @command_window.index
@commands_index_old = @command_window.index
@commands_shake_duration = 0
end
return if @commands_shake_duration == 10
@commands_shake_duration -= 1 if @commands_shake_duration > 0
@commands_shake_duration = 0 if !COMMAND_SHAKE
for i in @commands
if (i.z - 100) == @command_window.index
i.opacity += 255
i.x = COMMANDS_POS[0] + rand(@commands_shake_duration)
else
i.opacity -= 7 if i.opacity > 100
i.x = COMMANDS_POS[0]
end
end
end
end
$mog_rgss3_animated_title_a = true
# +++ MOG - Animated Title A (v2.4) +++
#==============================================================================
# By Moghunter
# https://atelierrgss.wordpress.com/
#==============================================================================
# Tela de titulo animado, com logo, imagens aleatórias e outros efeitos visuais.
#==============================================================================
#==============================================================================
# IMAGENS NECESSÁRIAS
#==============================================================================
# Serão necessários as seguintes imagens na pasta Graphics/Titles2/
#
# Cursor.png
# Commmand_Name.png (image filename = name of command)
# Particle.png (Opcional)
# Logo.jpg (Opcional)
# Animated.png (Opcional)
#==============================================================================
#==============================================================================
# NOTA 1 - Para definir a imagem de texto basta selecionar no banco de dados
# a imagem do titulo numero 2 (Segunda camada)
#==============================================================================
#==============================================================================
# NOTA 2 - O nome da imagem de comando é iguál ao nome do comando definido
# no banco de dados do Rpg Maker.
#==============================================================================
#==============================================================================
# ● Histórico (Version History)
#==============================================================================
# v 2.4 - Compatibilidade com resoluções acima do padrão.
# v 2.3 - O nome do comando não é mais baseado no database.
#==============================================================================
module MOG_SCENE_TITLE_A
#--------------------------------------------------------------------------
# ▼ LOGO ▼
#--------------------------------------------------------------------------
# Apresenta um Logo ao começar a tela de titulo.
# Será necessário ter a imagem LOGO.jpg (png) na pasta Graphics/Title2
#--------------------------------------------------------------------------
# Ativar Logo
LOGO = false
# Duração do logo.
LOGO_DURATION = nil #(Sec)
#--------------------------------------------------------------------------
# ▼ RANDOM BACKGROUND ▼
#--------------------------------------------------------------------------
#Definição das pictures.
#--------------------------------------------------------------------------
RANDOM_PICTURES = ["portada"]
#"portada", "Title0", "Title0"
#"Title4","Title5","Title6","Title7"
# ]
#Tempo de duração para ativar a troca de imagens.
RANDOM_PICTURES_DURATION = 999999 #(sec)
#Seleção aleatória.
RAMDOM_SELECTION = false
#Velocidade de Scrolling. (Speed X , Speed Y)
RANDOM_PICTURES_SCROLL_SPEED = [0,0]
#--------------------------------------------------------------------------
# ▼ MULTIPLE LAYERS ▼
#--------------------------------------------------------------------------
# Definição de multiplas camadas. * (não há limíte na quantidade de camadas
# usadas)
#--------------------------------------------------------------------------
# MULTIPLE_LAYERS = [ ["A",B,C,D], ["A",B,C,D], ["A",B,C D], ["A",B,C,D ], ....]
#
# A - Nome da imagem.
# B - Velocidade de scroll na horizontal.
# C - Velocidade de scroll na vertical.
# D - Tipo de Blend. (0 - Normal / 2 - Add / 3 - Substract)
#--------------------------------------------------------------------------
# ▼ PARTICLES ▼
#--------------------------------------------------------------------------
# Adiciona partículas animadas na tela do titulo.
# Será necessário ter a imagem PARTICLE.png na pasta Graphics/Title2
#--------------------------------------------------------------------------
# Ativar Partículas.
PARTICLE = true
# Ativar Cores Aleatórias.
PARTICLE_RANDOM_COLOR = false
# Definição do tipo de blend. (0,1,2)
PARTICLE_BLEND_TYPE = 1
#Definição do limite de velocidade das partículas.
PARTICLE_MOVEMENT_RANGE_X = 3
PARTICLE_MOVEMENT_RANGE_Y = 3
PARTICLE_ANGLE_RANGE = 3
#--------------------------------------------------------------------------
# ▼ WAVE TITLE ▼
#--------------------------------------------------------------------------
# Ativa o efeito WAVE no texto do titulo, o Texto do titulo é definido
# na camada do titulo 2, que pode ser definido através do banco de dados
#--------------------------------------------------------------------------
#Ativar o efeito do titulo com efeito WAVE.
TITLE_WAVE = false
#Configuração do efeito WAVE
#
# TITLE_WAVE_CONFIG = [ AMP, LENGTH , SPEED]
#
TITLE_WAVE_CONFIG = [6, 232, 360]
#--------------------------------------------------------------------------
# ▼ COMMANDS / SELECTION ▼
#--------------------------------------------------------------------------
# Configuração extras da tela de titulo.
#--------------------------------------------------------------------------
# Posição do comando.
COMMANDS_POS = [360, 220]
# Ativar o efeito de tremor ao selecionar o comando.
COMMAND_SHAKE = true
end
#==============================================================================
# ■ Window TitleCommand
#==============================================================================
class Window_TitleCommand < Window_Command
attr_reader :list
end
#==============================================================================
# ■ Particle Title
#==============================================================================
class Particle_Title < Sprite
include MOG_SCENE_TITLE_A
#--------------------------------------------------------------------------
# ● Initialize
#--------------------------------------------------------------------------
def initialize(viewport = nil)
super(viewport)
self.bitmap = Cache.title2("Particle2")
self.tone.set(rand(255),rand(255), rand(255), 255) if PARTICLE_RANDOM_COLOR
self.blend_type = PARTICLE_BLEND_TYPE
self.z = 50
@sc_x = [self.bitmap.width / 2, self.bitmap.width, Graphics.width ]
@sc_y = [self.bitmap.height / 2, self.bitmap.height, Graphics.height ]
@cw0 = self.bitmap.width / 2 ; @ch0 = self.bitmap.height / 2
@cw = self.bitmap.width + @cw0 ; @cw2 = Graphics.width
@ch = self.bitmap.height + @ch0 ; @ch2 = Graphics.height
@nx = PARTICLE_MOVEMENT_RANGE_X
@ny = PARTICLE_MOVEMENT_RANGE_Y
reset_setting
end
#--------------------------------------------------------------------------
# ● Reset Setting
#--------------------------------------------------------------------------
def reset_setting
zoom = (50 + rand(150)) / 150.1
self.zoom_x = zoom
self.zoom_y = zoom
self.x = rand(640)
self.y = rand(480 + self.bitmap.height)
self.opacity = 0
self.angle = rand(360)
self.blend_type = 1
@speed_x = 0
@speed_y = [[rand(-10), 0].min, 1].max
@speed_a = rand(2)
end
#--------------------------------------------------------------------------
# ● Dispose
#--------------------------------------------------------------------------
def dispose
super
self.bitmap.dispose
end
#--------------------------------------------------------------------------
# ● Update
#--------------------------------------------------------------------------
def update
super
self.x += @speed_x
self.y -= @speed_y
self.angle += @speed_a
self.opacity += 5
reset_setting if can_reset_setting?
end
#--------------------------------------------------------------------------
# ● Can Reset Setting
#--------------------------------------------------------------------------
def can_reset_setting?
return true if (self.x < -(@cw * 2) or self.x > (@cw2 + @cw))
return true if (self.y < -(@ch * 2) or self.y > (@ch2 + @ch))
return false
end
end
#==============================================================================
# ■ Multiple Layers Title
#==============================================================================
class Multiple_Layers_Title
#--------------------------------------------------------------------------
# ● Initialize
#--------------------------------------------------------------------------
def initialize(name = "", scroll_x = 0, scroll_y = 0, blend = 0, index = 0)
@layer = Plane.new
@layer.bitmap = Cache.title1(name.to_s) rescue nil
@layer.bitmap = Bitmap.new(32,32) if @layer.bitmap == nil
@layer.z = 10 + index
@layer.opacity = 0
@layer.blend_type = blend
@scroll_speed = [scroll_x, scroll_y]
end
#--------------------------------------------------------------------------
# ● Dispose
#--------------------------------------------------------------------------
def dispose
@layer.bitmap.dispose
@layer.bitmap = nil
@layer.dispose
end
#--------------------------------------------------------------------------
# ● Update
#--------------------------------------------------------------------------
def update
@layer.opacity += 2
@layer.ox += @scroll_speed[0]
@layer.oy += @scroll_speed[1]
end
end
#==============================================================================
# ■ Scene Title
#==============================================================================
class Scene_Title < Scene_Base
include MOG_SCENE_TITLE_A
#--------------------------------------------------------------------------
# ● Start
#--------------------------------------------------------------------------
def start
super
#RPG::BGM.fade(2000)
@logo_active = LOGO
SceneManager.clear
@phase = 1
@phase_time = -1
dispose_title_sprites
create_logo if @logo_active
create_command_window
create_commands
create_background
create_light
play_title_music
end
#--------------------------------------------------------------------------
# ● Create_Logo
#--------------------------------------------------------------------------
def create_logo
@phase = 0
@logo = Sprite.new
@logo.bitmap = Cache.title2("Logo")
@logo.opacity = 0
@logo_duration = 180 + (LOGO_DURATION * 60)
@logo.z = 200
end
#--------------------------------------------------------------------------
# ● Create Commands
#--------------------------------------------------------------------------
def create_commands
@command_window.visible = false
@commands_index_old = -1
@commands = []
@commands_shake_duration = 10
index = 0
for com in 0...3
sprite = Sprite.new
case index
when 0; com_name = "Adentrarse"
when 1; com_name = "Correr"
when 2; com_name = "Escapar"
#when 3; com_name = "Escapar"
end
sprite.bitmap = Cache.title2(com_name.to_s) rescue nil
if sprite.bitmap == nil
sprite.bitmap = Bitmap.new(200,32)
Font.default_name = ["Century"]
sprite.bitmap.font.size = 24
sprite.bitmap.font.bold = true
sprite.bitmap.font.italic = true
sprite.bitmap.draw_text(0, 0, 200, 32, com_name.to_s,1)
end
sprite.x = COMMANDS_POS[0] - 100 - (index * 20)
sprite.y = index * sprite.bitmap.height + COMMANDS_POS[1]
sprite.z = 100 + index
sprite.opacity = 0
index += 1
@commands.push(sprite)
end
@command_max = index
end
#--------------------------------------------------------------------------
# ● create_background
#--------------------------------------------------------------------------
def create_background
@rand_title_duration = 9999999
@old_back_index = 0
@sprite1 = Plane.new
@sprite1.opacity = 0
@sprite1.z = 1
if RAMDOM_SELECTION
execute_random_picture(false)
else
execute_random_picture(false)
end
@sprite2 = Sprite.new
@sprite2.bitmap = Cache.title2($data_system.title2_name)
@sprite2.z = 100
@sprite2.opacity = 0
if TITLE_WAVE
@sprite2.wave_amp = TITLE_WAVE_CONFIG[0]
@sprite2.wave_length = TITLE_WAVE_CONFIG[1]
@sprite2.wave_speed = TITLE_WAVE_CONFIG[2]
end
end
#--------------------------------------------------------------------------
# ● Create Light
#--------------------------------------------------------------------------
def create_light
return unless PARTICLE
@light_bitmap =[]
for i in 0...25
@light_bitmap.push(Particle_Title.new(nil))
end
end
#--------------------------------------------------------------------------
# ● dispose Background1
#--------------------------------------------------------------------------
def dispose_background1
@sprite1.bitmap.dispose
@sprite1.bitmap = nil
@sprite1.dispose
@sprite1 = nil
end
#--------------------------------------------------------------------------
# ● Dispose Background2
#--------------------------------------------------------------------------
def dispose_background2
if @sprite2.bitmap != nil
@sprite2.bitmap.dispose
@sprite2.bitmap = nil
@sprite2.dispose
@sprite2 = nil
end
end
#--------------------------------------------------------------------------
# ● Dispose Light
#--------------------------------------------------------------------------
def dispose_light
return unless PARTICLE
if @light_bitmap != nil
for i in @light_bitmap
i.dispose
end
@light_bitmap = nil
end
end
#--------------------------------------------------------------------------
# ● Dispose Logo
#--------------------------------------------------------------------------
def dispose_logo
return unless @logo_active
@logo.bitmap.dispose
@logo.dispose
end
#--------------------------------------------------------------------------
# ● Dispose Multiple Layers
#--------------------------------------------------------------------------
def dispose_multiple_layers
return if @m_layers == nil
@m_layers.each {|layer| layer.dispose }
end
#--------------------------------------------------------------------------
# ● Terminate
#--------------------------------------------------------------------------
def terminate
super
dispose_title_sprites
end
#--------------------------------------------------------------------------
# ● Dispose Title Sprites
#--------------------------------------------------------------------------
def dispose_title_sprites
return if @cursor == nil
dispose_background1
dispose_background2
dispose_light
dispose_logo
for com in @commands
com.bitmap.dispose
com.dispose
end
end
#--------------------------------------------------------------------------
# ● Update
#--------------------------------------------------------------------------
def update
super
update_logo
update_initial_animation
update_command
update_background
update_light
end
#--------------------------------------------------------------------------
# ● Make Object bitmap
#--------------------------------------------------------------------------
def make_object_bitmap
@object.bitmap.clear
src_rect_back = Rect.new(@object_width * @object_index, 0,@object_width,@object_image.height)
@object.bitmap.blt(0,0, @object_image, src_rect_back)
end
#--------------------------------------------------------------------------
# ● Update Logo
#--------------------------------------------------------------------------
def update_logo
return if @phase != 0
loop do
break if @logo_duration == 0
execute_logo
Graphics.update
Input.update
end
play_title_music
end
#--------------------------------------------------------------------------
# ● Execute Logo
#--------------------------------------------------------------------------
def execute_logo
if @logo_duration > 120 and (Input.trigger?:)C) or Input.trigger?:)B))
@logo_duration = 120
end
@logo_duration -= 1
if @logo_duration > 120
@logo.opacity += 5
else
@logo.opacity -= 5
end
if @logo.opacity <= 0
@logo_duration = 0
@phase = 1
end
end
#--------------------------------------------------------------------------
# ● Update Background
#--------------------------------------------------------------------------
def update_background
@sprite1.ox += RANDOM_PICTURES_SCROLL_SPEED[0]
@sprite1.oy += RANDOM_PICTURES_SCROLL_SPEED[1]
@sprite2.opacity += 2
@sprite2.update
return if RANDOM_PICTURES.size < 1
@rand_title_duration -= 1
if @rand_title_duration <= 0
@sprite1.opacity -= 5 unless RANDOM_PICTURES.size < 2
else
@sprite1.opacity += 5
end
return if @sprite1.opacity != 0
execute_random_picture
end
#--------------------------------------------------------------------------
# ● Execute Random Picture
#--------------------------------------------------------------------------
def execute_random_picture(initial = false)
@rand_title_duration = [[60 * RANDOM_PICTURES_DURATION, 9999].min, 60].max
if @sprite1.bitmap != nil
@sprite1.bitmap.dispose
@sprite1.bitmap = nil
end
if RAMDOM_SELECTION
rand_pic = rand(RANDOM_PICTURES.size)
if rand_pic == @old_back_index
rand_pic += 1
rand_pic = 0 if rand_pic >= RANDOM_PICTURES.size
end
@old_back_index = rand_pic
else
@old_back_index += 1 unless initial
@old_back_index = 0 if @old_back_index >= RANDOM_PICTURES.size
end
pic = RANDOM_PICTURES[@old_back_index]
@sprite1.bitmap = Cache.title1(pic) rescue nil
@sprite1.bitmap = Cache.title1("") if @sprite1.bitmap == nil
end
#--------------------------------------------------------------------------
# ● Update Light
#--------------------------------------------------------------------------
def update_light
return unless PARTICLE
if @light_bitmap != nil
for i in @light_bitmap
i.update
end
end
end
#--------------------------------------------------------------------------
# ● Update Initial Animation
#--------------------------------------------------------------------------
def update_initial_animation
return if @phase != 1
@phase_time -= 1 if @phase_time > 0
if @phase_time == 0
@phase = 2
@phase_time = 30
end
for i in @commands
index = 0
if i.x < COMMANDS_POS[0]
i.x += 5 + (2 * index)
i.opacity += 10
if i.x >= COMMANDS_POS[0]
i.x = COMMANDS_POS[0]
i.opacity = 255
if @phase_time < 15 / 2
@phase_time = 15
end
end
end
index += 1
end
end
#--------------------------------------------------------------------------
# * Play Title Screen Music
#--------------------------------------------------------------------------
def play_title_music
$data_system.title_bgm.play
RPG::BGS.stop
RPG::ME.stop
end
#--------------------------------------------------------------------------
# ● Update Command
#--------------------------------------------------------------------------
def update_command
return if @phase != 2
update_command_slide
end
#--------------------------------------------------------------------------
# ● Update Command Slide
#--------------------------------------------------------------------------
def update_command_slide
if @commands_index_old != @command_window.index
@commands_index_old = @command_window.index
@commands_shake_duration = 0
end
return if @commands_shake_duration == 10
@commands_shake_duration -= 1 if @commands_shake_duration > 0
@commands_shake_duration = 0 if !COMMAND_SHAKE
for i in @commands
if (i.z - 100) == @command_window.index
i.opacity += 255
i.x = COMMANDS_POS[0] + rand(@commands_shake_duration)
else
i.opacity -= 7 if i.opacity > 100
i.x = COMMANDS_POS[0]
end
end
end
end
$mog_rgss3_animated_title_a = true
Here I attach an image: (Sorry for the spanish)
As you can see, the load files don't appear.