NoctisLucis

Warper
Member
Joined
Oct 17, 2015
Messages
3
Reaction score
0
First Language
German
Primarily Uses
Hello,


i have tried the MOG_mokou Title script integrate with hk animated title screen V1


From MOG i want the Aura and Particle effect. Title BG and Command/menu from HK animated Title. :|


But they have an Error:


"class definition in method body" (on the line or below.. i don´t know the maker jump to the line after the error)


class Scene_Title
 #--------------------------------------------------------------------------
  # ● Update
 #--------------------------------------------------------------------------          
  def update
      update_command
      update_sprites
  end
    end


my code :rswt: :


#==============================================================================
# +++ MOG - Mokou Title Screen (v1.0) +++
#==============================================================================
# By Moghunter
# http://www.atelier-rgss.com/
#==============================================================================
# Tela de título animada com o tema da Fujiwara no Mokou, para os fans de Touhou.
# Naturalmente é possível customizar qualquer tipo de personagem.
#==============================================================================
module MOG_MOKOU_TITLE_SCRREN
$STILL_BG = false
NUMBER_OF_PARTICLES = 10
PARTICLES_BLEND_TYPE = 1
AURA_POSITION = [50,20]
CHARACTER_AURA_EFFECT = true
TRASITION_DURATION = 0
COMMAND_POSITION = [0,5]
$TITLE_MENU_X = 184
$TITLE_MENU_Y = 260
$LOGO_X = 50
$LOGO_Y = 0
$SPARK_COUNT = 350
$SPARK_SPEED = 10
$MENU_NEW = 260
$MENU_CONTINUE = 305
$MENU_EXIT = 345
$SYMBOL_SPEED = 1

$titleloop = 1
$SYMBOL_RESET = false
end



#==============================================================================
# ■ Scene Title
#==============================================================================
class Scene_Title
include MOG_MOKOU_TITLE_SCRREN

#--------------------------------------------------------------------------
# ● Main
#--------------------------------------------------------------------------
def main
Graphics.update
Graphics.freeze
execute_setup
execute_loop
dispose
end

#--------------------------------------------------------------------------
# ● Execute Setup
#--------------------------------------------------------------------------
def execute_setup
@phase = 0
@active = false
@continue_enabled = DataManager.save_file_exists?
@com_index = @continue_enabled ? 1 : 0
@com_index_old = @com_index
@com_index_max = 2
create_sprites
end

#--------------------------------------------------------------------------
# ● Execute Lopp
#--------------------------------------------------------------------------
def execute_loop
Graphics.transition(TRASITION_DURATION)
play_title_music
loop do
Input.update
update
Graphics.update
break if SceneManager.scene != self
end
end

end


#==============================================================================
# ■ Scene Title
#==============================================================================
class Scene_Title



#--------------------------------------------------------------------------
# ● Create Sprites
#--------------------------------------------------------------------------
def create_sprites
create_spark
create_background
create_menu
create_commands
create_particles
create_particles2
create_particles3
create_aura
create_layout
end

#--------------------------------------------------------------------------
# ● Create spark animation
#--------------------------------------------------------------------------
def create_spark
@spark01.x += $SPARK_SPEED
@spark02.x -= $SPARK_SPEED
if $SPARK_COUNT != 0
$SPARK_COUNT -= 1
else
$SPARK_COUNT = 350
@spark01.x = -172
@spark02.x = 544
end
if @spark01.opacity != 255
@spark01.opacity += 20
@spark02.opacity += 20
end
end

#--------------------------------------------------------------------------
# ● Create Background
#--------------------------------------------------------------------------
def create_background
@viewport1 = Viewport.new(0, 0, 1288, 891)
@viewport2 = Viewport.new(0, 0, 824, 480)
@viewport2.z = 10
if $STILL_BG == false
@sprite = Plane.new(@viewport1)
@sprite.bitmap = Cache.system("TitleBGLoop")
@sprite.oy = 371
@sprite.ox = 100
@sprite.z = -100
@wave = Sprite.new(@viewport1)
@wave.bitmap = Cache.system("TitleBGSprite")
@wave.oy = 371
@wave.ox = 100
@wave.wave_amp = 50
@wave.wave_length = 440
@wave.wave_speed = 1250
@wave.opacity = 125
@wave.z = 5
else
@sprite = Sprite.new
@sprite.bitmap = Cache.system("TitleBG")
@sprite.y = 0
@sprite.x = 0
@sprite.z = -100
end
end

#--------------------------------------------------------------------------
# ● Create menü
#--------------------------------------------------------------------------
def create_menu
@menu01 = Sprite.new
@menu01.bitmap = Cache.system("TitleMenu01")
@menu01.x = $TITLE_MENU_X
@menu01.y = $TITLE_MENU_Y
@menu02 = Sprite.new
@menu02.bitmap = Cache.system("TitleMenu02")
@menu02.x = $TITLE_MENU_X
@menu02.y = $TITLE_MENU_Y
@menu02.opacity = 0
@menu03 = Sprite.new
@menu03.bitmap = Cache.system("TitleMenu03")
@menu03.x = $TITLE_MENU_X
@menu03.y = $TITLE_MENU_Y
@menu03.opacity = 0
@cursor = Sprite.new
@cursor.bitmap = Cache.system("TitleCursor")
@cursor.x = $TITLE_MENU_X
@cursor.y = $TITLE_MENU_Y
@cursor.z = 12
@strike1 = Sprite.new
@strike1.bitmap = Cache.system("TitleCursorStrike01")
@strike1.x = 0
@strike1.y = 260
@strike1.z = 9
@strike2 = Sprite.new
@strike2.bitmap = Cache.system("TitleCursorStrike02")
@strike2.x = 212
@strike2.y = 260
@strike2.z = 9
@symbol = Plane.new(@viewport2)
@symbol.bitmap = Cache.system("TitleSymbol")
@symbol.oy = 443
@symbol.ox = 100
@spark01 = Sprite.new
@spark01.bitmap = Cache.system("TitleSpark01")
@spark01.y = 280
@spark01.x = -172
@spark01.z = 12
@spark02 = Sprite.new
@spark02.bitmap = Cache.system("TitleSpark02")
@spark02.y = 300
@spark02.x = 544
@spark02.z = 12
@menu01.z = @menu02.z = @menu03.z = 13
if @continue_enabled
@menu01.opacity = 0
@menu02.opacity = 255
@cursor.y = 305
@strike1.y = 305
@strike2.y = 305
@symbol.oy = 398
end
end

#--------------------------------------------------------------------------
# ● Create Layout
#--------------------------------------------------------------------------
def create_layout
@logo = Sprite.new
@logo.bitmap = Cache.system("Layout")
@logo.x = $LOGO_X
@logo.y = $LOGO_Y
@logo.z = 10
end

#--------------------------------------------------------------------------
# ● Create Particles
#--------------------------------------------------------------------------
def create_particles
@particles_sprite =[]
for i in 0...NUMBER_OF_PARTICLES
@particles_sprite.push(Particles_Title.new(nil))
end
end

#--------------------------------------------------------------------------
# ● Create Particles
#--------------------------------------------------------------------------
def create_particles2
@particles_sprite2 =[]
for i in 0...NUMBER_OF_PARTICLES
@particles_sprite2.push(Particles_Title2.new(nil))
end
end

#--------------------------------------------------------------------------
# ● Create Particles
#--------------------------------------------------------------------------
def create_particles3
@particles_sprite3 =[]
for i in 0...NUMBER_OF_PARTICLES
@particles_sprite3.push(Particles_Title3.new(nil))
end
end


#--------------------------------------------------------------------------
# ● Create Aura
#--------------------------------------------------------------------------
def create_aura
@aura = Sprite.new
@aura.bitmap = Cache.title1("Aura")
@aura.x = AURA_POSITION[0] + @aura.ox
@aura.y = AURA_POSITION[1] + @aura.oy
@aura.z = 2
@aura.blend_type = 1
@aura.opacity = 255
@aura_zoom_phase = [0,0]
end
end

#==============================================================================
# ■ Particles Title
#==============================================================================
class Particles_Title2 < Sprite

include MOG_MOKOU_TITLE_SCRREN

#--------------------------------------------------------------------------
# ● Initialize
#--------------------------------------------------------------------------
def initialize(viewport = nil)
super(viewport)
@speed_x = 0
@speed_y = 0
@speed_a = 0
@next_pos = [440,190]
self.bitmap = Cache.title1("Particles2")
self.blend_type = PARTICLES_BLEND_TYPE
self.z = 4
@cy_size = self.bitmap.height + (self.bitmap.height / 2)
@cy_limit = Graphics.height + @cy_size
@rg = [Graphics.width - self.bitmap.width ,0]
@phase = 0
reset_setting(true)
end

#--------------------------------------------------------------------------
# ● Reset Setting
#--------------------------------------------------------------------------
def reset_setting(initial = false)
zoom = (50 + rand(100)) / 100.1
self.zoom_x = zoom
self.zoom_y = zoom
self.x = rand(576) - 160
self.y = initial == true ? rand(480) : -@cy_size
@speed_y = (1 + rand(3))
@speed_x = (1 + rand(2))
@speed_a = (1 + rand(2))
@rg[1] = (Graphics.height / 2) + rand(128)
@phase = 0
end

#--------------------------------------------------------------------------
# ● Dispose
#--------------------------------------------------------------------------
def dispose
super
self.bitmap.dispose if self.bitmap != nil
end

#--------------------------------------------------------------------------
# ● Update
#--------------------------------------------------------------------------
def update
super
if @phase == 0 and self.y < @rg[1] and self.x < @rg[0]
self.x += @speed_x
self.y += @speed_y
else
@phase = 1
update_slide(0,@next_pos[0])
update_slide(1,@next_pos[1])
end
self.opacity += 5
reset_setting if can_reset_setting?
end

#--------------------------------------------------------------------------
# ● Can Reset Setting
#--------------------------------------------------------------------------
def can_reset_setting?
return true if self.x == @next_pos[0] and self.y == @next_pos[1]
# return true if self.opacity <= 1
return false
end

#--------------------------------------------------------------------------
# ● Update Slide
#--------------------------------------------------------------------------
def update_slide(type,np)
cp = type == 0 ? self.x : self.y
sp = 2 + ((cp - np).abs / 20)
if cp > np
cp -= sp
cp = np if cp < np
elsif cp < np
cp += sp
cp = np if cp > np
end
self.x = cp if type == 0
self.y = cp if type == 1
end

end

#==============================================================================
# ■ Particles Title
#==============================================================================
class Particles_Title3 < Sprite

include MOG_MOKOU_TITLE_SCRREN

#--------------------------------------------------------------------------
# ● Initialize
#--------------------------------------------------------------------------
def initialize(viewport = nil)
super(viewport)
@speed_x = 0
@speed_y = 0
@speed_a = 0
@next_pos = [440,190]
self.bitmap = Cache.title1("Particles3")
self.blend_type = PARTICLES_BLEND_TYPE
self.z = 4
@cy_size = self.bitmap.height + (self.bitmap.height / 2)
@cy_limit = Graphics.height + @cy_size
@rg = [Graphics.width - self.bitmap.width ,0]
@phase = 0
reset_setting(true)
end

#--------------------------------------------------------------------------
# ● Reset Setting
#--------------------------------------------------------------------------
def reset_setting(initial = false)
zoom = (50 + rand(100)) / 100.1
self.zoom_x = zoom
self.zoom_y = zoom
self.x = 440 + rand(self.bitmap.width) # - 160
self.y = 190 + rand(self.bitmap.height) #initial == true ? rand(480) : -@cy_size
self.opacity = 255
@speed_y = (1 + rand(3))
@speed_x = (1 + rand(2))
@speed_a = (1 + rand(2))
@rg[1] = (Graphics.height / 2) + rand(128)
@phase = 0
end

#--------------------------------------------------------------------------
# ● Dispose
#--------------------------------------------------------------------------
def dispose
super
self.bitmap.dispose if self.bitmap != nil
end

#--------------------------------------------------------------------------
# ● Update
#--------------------------------------------------------------------------
def update
super
# self.x += @speed_x
self.y -= @speed_y
self.opacity -= 3
reset_setting if can_reset_setting?
end

#--------------------------------------------------------------------------
# ● Can Reset Setting
#--------------------------------------------------------------------------
def can_reset_setting?
return true if self.y < 0
return false
end

end

#==============================================================================
# ■ Particles Title
#==============================================================================
class Particles_Title < Sprite

include MOG_MOKOU_TITLE_SCRREN

#--------------------------------------------------------------------------
# ● Initialize
#--------------------------------------------------------------------------
def initialize(viewport = nil)
super(viewport)
@speed_x = 0
@speed_y = 0
@speed_a = 0
@speed_o = 0
self.bitmap = Cache.title1("Particles")
self.blend_type = PARTICLES_BLEND_TYPE
self.z = 4
@cy_size = self.bitmap.height + (self.bitmap.height / 2)
@cy_limit = Graphics.height - (@cy_size * 3)
reset_setting(true)
end

#--------------------------------------------------------------------------
# ● Reset Setting
#--------------------------------------------------------------------------
def reset_setting(initial = false)
zoom = (50 + rand(100)) / 100.1
self.zoom_x = zoom
self.zoom_y = zoom
self.x = rand(Graphics.width)
self.y = initial == true ? rand(480) : (Graphics.height + @cy_size)
self.opacity = 255
z = rand(2)
if z == 1
self.z = 40
else
self.z = 20
end
@speed_y = -(1 + rand(3))
@speed_x = (1 + rand(2))
@speed_a = (1 + rand(2))
@speed_o = (2 + rand(8))
end

#--------------------------------------------------------------------------
# ● Dispose
#--------------------------------------------------------------------------
def dispose
super
self.bitmap.dispose if self.bitmap != nil
end

#--------------------------------------------------------------------------
# ● Update
#--------------------------------------------------------------------------
def update
super
self.y += @speed_y
self.opacity -= @speed_o
reset_setting if can_reset_setting?
end

#--------------------------------------------------------------------------
# ● Can Reset Setting
#--------------------------------------------------------------------------
def can_reset_setting?
return true if self.opacity == 0
return true if self.y < -@cy_size
return false
end

end

#==============================================================================
# ■ Scene Title
#==============================================================================
class Scene_Title

#--------------------------------------------------------------------------
# ● Dispose
#--------------------------------------------------------------------------
def dispose
Graphics.freeze
dispose_background
dispose_particles
dispose_particles2
dispose_particles3
dispose_aura
dispose_layout
dispose_commands
if $STILL_BG == false
@wave.dispose
@wave.bitmap.dispose
end
@sprite.dispose
@logo.dispose
@menu01.dispose
@menu02.dispose
@menu03.dispose
@cursor.dispose
@strike1.dispose
@strike2.dispose
@symbol.dispose
@spark01.dispose
@spark02.dispose
@logo.bitmap.dispose
@menu01.bitmap.dispose
@menu02.bitmap.dispose
@menu03.bitmap.dispose
@cursor.bitmap.dispose
@strike1.bitmap.dispose
@strike2.bitmap.dispose
@spark01.bitmap.dispose
@spark02.bitmap.dispose

end


#--------------------------------------------------------------------------
# ● Dispose Layout
#--------------------------------------------------------------------------
def dispose_layout
@layout.bitmap.dispose
@layout.dispose
end

#--------------------------------------------------------------------------
# ● Dispose Commands
#--------------------------------------------------------------------------
def dispose_commands
@com.each {|sprite| sprite.dispose_sprites }
end



#--------------------------------------------------------------------------
# ● Dispose Particles
#--------------------------------------------------------------------------
def dispose_particles
@particles_sprite.each {|sprite| sprite.dispose }
end

#--------------------------------------------------------------------------
# ● Dispose Particles 2
#--------------------------------------------------------------------------
def dispose_particles2
@particles_sprite2.each {|sprite| sprite.dispose }
end

#--------------------------------------------------------------------------
# ● Dispose Particles 3
#--------------------------------------------------------------------------
def dispose_particles3
@particles_sprite3.each {|sprite| sprite.dispose }
end



#--------------------------------------------------------------------------
# ● Dispose Aura
#--------------------------------------------------------------------------
def dispose_aura
@aura.bitmap.dispose
@aura.dispose
end

end

#==============================================================================
# ■ Scene Title
#==============================================================================
class Scene_Title

#--------------------------------------------------------------------------
# ● Update Sprites
#--------------------------------------------------------------------------
def update_sprites
update_background
update_particles
update_particles2
update_particles3
update_commands
update_aura

end

#--------------------------------------------------------------------------
# ● Update Background
#--------------------------------------------------------------------------
def update_background
if $STILL_BG == false
@wave.update
if @sprite.oy != 0
@sprite.oy -= 1
elsif @sprite.oy == 0
@sprite.ox += 1
end
if @wave.oy != 0
@wave.oy -= 1
elsif @wave.oy == 0
if $TITLE_LOOP == 1 && @wave.ox != 1289
@wave.ox += 1
else
$TITLE_LOOP == 2
end
if $TITLE_LOOP == 2 && @wave.ox != -1189
@wave.ox -= 1
else
$TITLE_LOOP == 1
end
end
@symbol.ox -= $SYMBOL_SPEED
if $SYMBOL_RESET == true && @symbol.opacity == 0
$SYMBOL_RESET = false
elsif @symbol.opacity != 255
@symbol.opacity += 3
end

#--------------------------------------------------------------------------
# ● Update Commands
#--------------------------------------------------------------------------
def update_commands
@com.each {|sprite| sprite.update_sprites(@com_index,@active)}
end


#--------------------------------------------------------------------------
# ● Update Particles
#--------------------------------------------------------------------------
def update_particles
@particles_sprite.each {|sprite| sprite.update }
end

#--------------------------------------------------------------------------
# ● Update Particles 2
#--------------------------------------------------------------------------
def update_particles2
@particles_sprite2.each {|sprite| sprite.update }
end

#--------------------------------------------------------------------------
# ● Update Particles 3
#--------------------------------------------------------------------------
def update_particles3
@particles_sprite3.each {|sprite| sprite.update }
end

#--------------------------------------------------------------------------
# ● Update Aura
#--------------------------------------------------------------------------
def update_aura
if @aura_zoom_phase[0] == 0
@aura.zoom_x += 0.001
if @aura.zoom_x > 1.10
@aura_zoom_phase[0] = 1
@aura.zoom_x = 1.10
end
else
@aura.zoom_x -= 0.001
if @aura.zoom_x < 1.00
@aura_zoom_phase[0] = 0
@aura.zoom_x = 1.00
end

end
@aura.zoom_y = @aura.zoom_x
end


end

#==============================================================================
# ■ Scene Title
#==============================================================================
class Scene_Title

#--------------------------------------------------------------------------
# ● Update
#--------------------------------------------------------------------------
def update
update_command
update_sprites
end

end

#==============================================================================
# ■ Scene Title
#==============================================================================
class Scene_Title

#--------------------------------------------------------------------------
# ● Update Command
#--------------------------------------------------------------------------
def update_command
update_key
refresh_index if @com_index_old != @com_index
end

#--------------------------------------------------------------------------
# ● Update Key
#--------------------------------------------------------------------------
def update_key
when 0
@spark01.y = $MENU_NEW - 20
@spark02.y = $MENU_NEW
@symbol.oy = $MENU_NEW + 183
@strike1.y = $MENU_NEW
@strike2.y = $MENU_NEW
if @menu01.opacity != 255
@menu01.opacity += 20
@menu02.opacity -= 20
@menu03.opacity -= 20
end
if @cursor.y != $TITLE_MENU_Y
@cursor.y -= 5
end
when 1
@spark01.y = $MENU_CONTINUE - 20
@spark02.y = $MENU_CONTINUE
@symbol.oy = $MENU_CONTINUE + 93
@strike1.y = $MENU_CONTINUE
@strike2.y = $MENU_CONTINUE
if @menu02.opacity != 255
@menu02.opacity += 20
@menu01.opacity -= 20
@menu03.opacity -= 20
end
if @cursor.y != $MENU_CONTINUE && @cursor.y < $MENU_CONTINUE
@cursor.y += 5
elsif @cursor.y != $MENU_CONTINUE && @cursor.y > $MENU_CONTINUE
@cursor.y -= 5
end
when 2
@spark01.y = $MENU_EXIT - 20
@spark02.y = $MENU_EXIT
@symbol.oy = $MENU_EXIT + 13
@strike1.y = $MENU_EXIT
@strike2.y = $MENU_EXIT
if @menu03.opacity != 255
@menu03.opacity += 20
@menu02.opacity -= 20
@menu01.opacity -= 20
end
if @cursor.y != $MENU_EXIT
@cursor.y += 5
end
end
if @strike1.x != 0
@strike1.x += 11
end
if @strike2.x != 212
@strike2.x -= 12
end
check_menu
if Input.trigger?(Input::C)
case @command_window.index
when 0 #New game
command_new_game
when 1 # Continue
command_continue
when 2 # Shutdown
command_shutdown
end
end




#--------------------------------------------------------------------------
# ● Refresh Index
#--------------------------------------------------------------------------
def refresh_index
@com_index_old = @com_index
Sound.play_cursor
end

#--------------------------------------------------------------------------
# ● Command New Game
#--------------------------------------------------------------------------
def command_new_game
Sound.play_ok
DataManager.setup_new_game
fadeout_all
$game_map.autoplay
SceneManager.goto(Scene_Map)
end

#--------------------------------------------------------------------------
# ● Command Continue
#--------------------------------------------------------------------------
def command_continue
if !@continue_enabled
Sound.play_cancel
return
else
Sound.play_ok
end
SceneManager.call(Scene_Load)
end

#--------------------------------------------------------------------------
# ● Command Shutdown
#--------------------------------------------------------------------------
def command_shutdown
Sound.play_ok
fadeout_all
SceneManager.exit
end

#--------------------------------------------------------------------------
# ● play_title_music
#--------------------------------------------------------------------------
def play_title_music
$data_system.title_bgm.play
RPG::BGS.stop
RPG::ME.stop
end

#--------------------------------------------------------------------------
# ● Fadeout_all
#--------------------------------------------------------------------------
def fadeout_all(time = 1000)
RPG::BGM.fade(time)
RPG::BGS.fade(time)
RPG::ME.fade(time)
Graphics.fadeout(time * Graphics.frame_rate / 1000)
RPG::BGM.stop
RPG::BGS.stop
RPG::ME.stop
end
end

$mog_rgss3_mokou_title_screen = true




original code from HK animated


#==============================================================================
# Hanzo Kimura's Animated Title Screen (Translated by BlueTyphlosion)
# Scripted Date: 02/24/09
# PLEASE CREDIT: Hanzo Kimura
# if Your going to use this script for your title
#
# IMAGES USED(All in Graphics/System) Folder:
# "TitleBGLoop.jpg" - For Scrolling Upward Effect
# "TitleBGSprite.jpg" - For Horizantally Endless Scrolling
# "TitleCursor.png" - For the title cursor
# "TitleMenu01.png" - For the title Menu (First Menu Active)
# "TitleMenu02.png" - For the title Menu (Second Menu Active)
# "TitleMenu03.png" - For the title Menu (Third Menu Active)
# "TitleLogo.png" - For the Title Logo
# "TitleSpark01.png" - For the Title Spark
# "TitleSpark02.png" - For the Title Spark
# "TitleSymbol.png" - For the Title Symbol
# "TitleCursorStrike01.png" - For Title Cursor Strike Effect(Left)
# "TitleCursorStrike02.png" - For Title Cursor Strike Effect(Right)
# **"TitleBG.jpg" - For Still Version Title Background
#
# UPDATE #1
# ***New Function Added '$STILL_BG' Let's you control the Background behavior
# Set it to True if you want the Animated Waving Effect,
# Set it to False if you want a Still Background
# ***640x480 Version Added
#
# IF YOU FIND ANY BUGS REPORT HERE:
# http://www.rpgmakervx.net/index.php?showtopic=16133&st=60
#
#==============================================================================
#NEW FUNCTION
$STILL_BG = false # true=Still Background false=Animated Background
#'TitleBG' is the filename that will be used for Still BG

$TITLE_MENU_X = 184 # Your Title Menu X Position
$TITLE_MENU_Y = 260 # Your Title Menu Y Position
$LOGO_X = 50 # Your Logo X Position
$LOGO_Y = 0 # Your Logo Y Position
$SPARK_COUNT = 350 # SPARK COUNT: Frames Before the Spark Appears again
$SPARK_SPEED = 10 # The Speed of the Sparks
$MENU_NEW = 260 # THE Y Position of the Cursor if NEW GAME
$MENU_CONTINUE = 305 # THE Y Position of the Cursor if CONTINUE
$MENU_EXIT = 345 # THE Y Position of the Cursor if EXIT
$SYMBOL_SPEED = 1

#DONT EDIT BELOW
$titleloop = 1
$SYMBOL_RESET = false
#------------------------------------------------------------------------------
# This class performs the title screen processing.
#==============================================================================
class Scene_Title < Scene_Base
def start
super
SceneManager.clear
Graphics.freeze
create_command_window
create_title_background
play_title_music
end
alias create_command_window_hk create_command_window
def create_command_window
create_command_window_hk
@command_window.visible = false
end
def update
super
if $STILL_BG == false
@wave.update
if @sprite.oy != 0
@sprite.oy -= 1
elsif @sprite.oy == 0
@sprite.ox += 1
end
if @wave.oy != 0
@wave.oy -= 1
elsif @wave.oy == 0
if $TITLE_LOOP == 1 && @wave.ox != 1289
@wave.ox += 1
else
$TITLE_LOOP == 2
end
if $TITLE_LOOP == 2 && @wave.ox != -1189
@wave.ox -= 1
else
$TITLE_LOOP == 1
end
end
end
@symbol.ox -= $SYMBOL_SPEED
if $SYMBOL_RESET == true && @symbol.opacity == 0
$SYMBOL_RESET = false
elsif @symbol.opacity != 255
@symbol.opacity += 3
end


#=======Spark Animation========
@spark01.x += $SPARK_SPEED
@spark02.x -= $SPARK_SPEED
if $SPARK_COUNT != 0
$SPARK_COUNT -= 1
else
$SPARK_COUNT = 350
@spark01.x = -172
@spark02.x = 544
end
if @spark01.opacity != 255
@spark01.opacity += 20
@spark02.opacity += 20
end


#=======Menu Animation=========
case @command_window.index
when 0
@spark01.y = $MENU_NEW - 20
@spark02.y = $MENU_NEW
@symbol.oy = $MENU_NEW + 183
@strike1.y = $MENU_NEW
@strike2.y = $MENU_NEW
if @menu01.opacity != 255
@menu01.opacity += 20
@menu02.opacity -= 20
@menu03.opacity -= 20
end
if @cursor.y != $TITLE_MENU_Y
@cursor.y -= 5
end
when 1
@spark01.y = $MENU_CONTINUE - 20
@spark02.y = $MENU_CONTINUE
@symbol.oy = $MENU_CONTINUE + 93
@strike1.y = $MENU_CONTINUE
@strike2.y = $MENU_CONTINUE
if @menu02.opacity != 255
@menu02.opacity += 20
@menu01.opacity -= 20
@menu03.opacity -= 20
end
if @cursor.y != $MENU_CONTINUE && @cursor.y < $MENU_CONTINUE
@cursor.y += 5
elsif @cursor.y != $MENU_CONTINUE && @cursor.y > $MENU_CONTINUE
@cursor.y -= 5
end
when 2
@spark01.y = $MENU_EXIT - 20
@spark02.y = $MENU_EXIT
@symbol.oy = $MENU_EXIT + 13
@strike1.y = $MENU_EXIT
@strike2.y = $MENU_EXIT
if @menu03.opacity != 255
@menu03.opacity += 20
@menu02.opacity -= 20
@menu01.opacity -= 20
end
if @cursor.y != $MENU_EXIT
@cursor.y += 5
end
end
if @strike1.x != 0
@strike1.x += 11
end
if @strike2.x != 212
@strike2.x -= 12
end
check_menu
if Input.trigger?(Input::C)
case @command_window.index
when 0 #New game
command_new_game
when 1 # Continue
command_continue
when 2 # Shutdown
command_shutdown
end
end
end
#--------------------------------------------------------------------------
# * Checking Current Menu
#--------------------------------------------------------------------------
def check_menu
if Input.trigger?(Input::UP) or Input.trigger?(Input::DOWN)
$SPARK_COUNT = 350
@spark01.x = -172
@spark02.x = 544
@spark01.opacity -= 255
@spark02.opacity -= 255
@symbol.opacity -= 255
$SYMBOL_RESET = true
case @command_window.index
when 0
@spark01.y = 280
@spark02.y = 300
@symbol.oy = 403
@strike1.y = 300
@strike2.y = 300
@strike1.x = -330
@strike2.x = 584
when 1
@spark01.y = 325
@spark02.y = 345
@symbol.oy = 358
@strike1.y = 345
@strike2.y = 345
@strike1.x = -330
@strike2.x = 584
when 2
@spark01.y = 365
@spark02.y = 385
@symbol.oy = 317
@strike1.y = 385
@strike2.y = 385
@strike1.x = -330
@strike2.x = 584
end
end
end
def create_title_background
@viewport1 = Viewport.new(0, 0, 1288, 891)
@viewport2 = Viewport.new(0, 0, 824, 480)
@viewport2.z = 10
if $STILL_BG == false
@sprite = Plane.new(@viewport1)
@sprite.bitmap = Cache.system("TitleBGLoop")
@sprite.oy = 371
@sprite.ox = 100
@sprite.z = -100
@wave = Sprite.new(@viewport1)
@wave.bitmap = Cache.system("TitleBGSprite")
@wave.oy = 371
@wave.ox = 100
@wave.wave_amp = 50
@wave.wave_length = 440
@wave.wave_speed = 1250
@wave.opacity = 125
@wave.z = 5

else
@sprite = Sprite.new
@sprite.bitmap = Cache.system("TitleBG")
@sprite.y = 0
@sprite.x = 0
@sprite.z = -100
end
@logo = Sprite.new
@logo.bitmap = Cache.system("Layout")
@logo.x = $LOGO_X
@logo.y = $LOGO_Y
@logo.z = 10
@menu01 = Sprite.new
@menu01.bitmap = Cache.system("TitleMenu01")
@menu01.x = $TITLE_MENU_X
@menu01.y = $TITLE_MENU_Y
@menu02 = Sprite.new
@menu02.bitmap = Cache.system("TitleMenu02")
@menu02.x = $TITLE_MENU_X
@menu02.y = $TITLE_MENU_Y
@menu02.opacity = 0
@menu03 = Sprite.new
@menu03.bitmap = Cache.system("TitleMenu03")
@menu03.x = $TITLE_MENU_X
@menu03.y = $TITLE_MENU_Y
@menu03.opacity = 0
@cursor = Sprite.new
@cursor.bitmap = Cache.system("TitleCursor")
@cursor.x = $TITLE_MENU_X
@cursor.y = $TITLE_MENU_Y
@cursor.z = 12
@strike1 = Sprite.new
@strike1.bitmap = Cache.system("TitleCursorStrike01")
@strike1.x = 0
@strike1.y = 260
@strike1.z = 9
@strike2 = Sprite.new
@strike2.bitmap = Cache.system("TitleCursorStrike02")
@strike2.x = 212
@strike2.y = 260
@strike2.z = 9
@symbol = Plane.new(@viewport2)
@symbol.bitmap = Cache.system("TitleSymbol")
@symbol.oy = 443
@symbol.ox = 100
@spark01 = Sprite.new
@spark01.bitmap = Cache.system("TitleSpark01")
@spark01.y = 280
@spark01.x = -172
@spark01.z = 12
@spark02 = Sprite.new
@spark02.bitmap = Cache.system("TitleSpark02")
@spark02.y = 300
@spark02.x = 544
@spark02.z = 12
@menu01.z = @menu02.z = @menu03.z = 13
if @continue_enabled
@menu01.opacity = 0
@menu02.opacity = 255
@cursor.y = 305
@strike1.y = 305
@strike2.y = 305
@symbol.oy = 398
end
end


#--------------------------------------------------------------------------
# * Dispose of Title Graphic
#--------------------------------------------------------------------------
def dispose_title_background
if $STILL_BG == false
@wave.dispose
@wave.bitmap.dispose
end
@sprite.dispose
@logo.dispose
@menu01.dispose
@menu02.dispose
@menu03.dispose
@cursor.dispose
@strike1.dispose
@strike2.dispose
@symbol.dispose
@spark01.dispose
@spark02.dispose
@logo.bitmap.dispose
@menu01.bitmap.dispose
@menu02.bitmap.dispose
@menu03.bitmap.dispose
@cursor.bitmap.dispose
@strike1.bitmap.dispose
@strike2.bitmap.dispose
@spark01.bitmap.dispose
@spark02.bitmap.dispose
end
def terminate
super
SceneManager.snapshot_for_background
dispose_title_background
end
end


from Mokou title the original code:

Code:
#==============================================================================
# +++ MOG - Mokou Title Screen (v1.0) +++
#==============================================================================
# By Moghunter 
# http://www.atelier-rgss.com/
#==============================================================================
# Tela de título animada com o tema da Fujiwara no Mokou, para os fans de Touhou.
# Naturalmente é possível customizar qualquer tipo de personagem.
#==============================================================================
module MOG_MOKOU_TITLE_SCRREN
  #Definição da velocidade de deslize da imagem de fundo.
  BACKGROUND_SCROLL_SPEED = [1,0]
  #Definição da quantidade de partículas.
  NUMBER_OF_PARTICLES = 10
  #Definição do tipo de blend da partícula.
  PARTICLES_BLEND_TYPE  = 1
  #Definição da força do efeito wave na névoa.
  FIRE_WIND_POWER = 10
  #Definição da velocidade do efeito wave na névoa.
  FIRE_WIND_SPEED = 4
  #Tipo de Blend.
  FIRE_BLEND_TYPE = 1
  #Definição da opacidade da névoa.
  FIRE_OPACITY = 155
  #Definição da posição do personagem.
  CHARACTER_POSITION = [150,27]
  #Posição da aura.
  AURA_POSITION = [50,20]
  #Definição da posição do comando.
  COMMAND_POSITION = [0,5]
  #Ativar efeito aura na imagem do personagem.
  CHARACTER_AURA_EFFECT = true
  #Ativar Logo.
  LOGO = true
  #Definição da duração do logo.
  LOGO_DURATION = 2
  #Definição do tempo de transição.
  TRASITION_DURATION = 0
end

#==============================================================================
# ■ Scene Title
#==============================================================================
class Scene_Title
  include MOG_MOKOU_TITLE_SCRREN
  
  #--------------------------------------------------------------------------
  # ● Main
  #--------------------------------------------------------------------------        
  def main
      execute_logo if LOGO
      Graphics.update
      Graphics.freeze
      execute_setup
      execute_loop
      dispose
  end  
  
  #--------------------------------------------------------------------------
  # ● Execute Setup
  #--------------------------------------------------------------------------        
  def execute_setup
      @phase = 0
      @active = false
      @continue_enabled = DataManager.save_file_exists?
      @com_index = @continue_enabled ? 1 : 0
      @com_index_old = @com_index
      @com_index_max = 2
      create_sprites
  end
  
  #--------------------------------------------------------------------------
  # ● Execute Lopp
  #--------------------------------------------------------------------------        
  def execute_loop
      Graphics.transition(TRASITION_DURATION)
      play_title_music
      loop do
         Input.update
         update
         Graphics.update
         break if SceneManager.scene != self
      end
   end
      
end
 
#==============================================================================
# ■ Scene Title
#==============================================================================
class Scene_Title
  include MOG_MOKOU_TITLE_SCRREN
  
  #--------------------------------------------------------------------------
  # ● Execute Logo
  #--------------------------------------------------------------------------    
  def execute_logo
      Graphics.transition
      create_logo 
      loop do
         Input.update
         update_logo
         Graphics.update
         break if !@logo_phase
      end
      dispose_logo
  end
   
  #--------------------------------------------------------------------------
  # ● Create Logo
  #--------------------------------------------------------------------------      
  def create_logo
      @logo = Sprite.new
      @logo.z = 100
      @logo.opacity = 0
      @logo_duration = [0,60 * LOGO_DURATION]
      @logo.bitmap = Cache.title1("Logo") rescue nil
      @logo_phase = @logo.bitmap != nil ? true : false      
  end
  
  #--------------------------------------------------------------------------
  # ● Dispose Logo
  #--------------------------------------------------------------------------       
  def dispose_logo      
      Graphics.freeze
      @logo.bitmap.dispose if @logo.bitmap != nil
      @logo.dispose
  end
  
  #--------------------------------------------------------------------------
  # ● Update Logo
  #--------------------------------------------------------------------------      
  def update_logo  
      return if !@logo_phase
      update_logo_command
      if @logo_duration[0] == 0
         @logo.opacity += 5
         @logo_duration[0] = 1 if @logo.opacity >= 255
       elsif @logo_duration[0] == 1
         @logo_duration[1] -= 1
         @logo_duration[0] = 2 if @logo_duration[1] <= 0
       else  
         @logo.opacity -= 5
         @logo_phase = false if @logo.opacity <= 0
       end
  end
  
  #--------------------------------------------------------------------------
  # ● Update Logo Command
  #--------------------------------------------------------------------------      
  def update_logo_command
      return if @logo_duration[0] == 2
      if Input.trigger?(:C) or Input.trigger?(:B)
         @logo_duration = [2,0]
      end
  end
  
end

#==============================================================================
# ■ Scene Title
#==============================================================================
class Scene_Title
  
  #--------------------------------------------------------------------------
  # ● Create Sprites
  #--------------------------------------------------------------------------          
  def create_sprites
      create_background
      create_fire_wind
      create_commands
      create_particles
      create_particles2
      create_particles3
      create_flame
      create_character
      create_aura
      create_layout
  end
    
  #--------------------------------------------------------------------------
  # ● Create Background
  #--------------------------------------------------------------------------            
  def create_background
      @background = Plane.new
      @background.bitmap = Cache.title1("Background")
      @background_scroll = [BACKGROUND_SCROLL_SPEED[0],BACKGROUND_SCROLL_SPEED[1],0]
      @background.z = 0
  end
  
  #--------------------------------------------------------------------------
  # ● Create Layout
  #--------------------------------------------------------------------------              
  def create_layout
      @layout = Sprite.new
      @layout.bitmap = Cache.title1("Layout")
      @layout.z = 20
      @layout.opacity = 0
  end
  
  #--------------------------------------------------------------------------
  # ● Create Flame
  #--------------------------------------------------------------------------              
  def create_flame
      @flame = []
      for index in 0...3
          @flame.push(Sprite.new)
          @flame[index].bitmap = Cache.title1("Flame")
          @flame[index].ox = @flame[index].bitmap.width / 2
          @flame[index].oy = @flame[index].bitmap.height / 2
          @flame[index].z = 5
          @flame[index].x = 450 
          @flame[index].y = 180
          @flame[index].blend_type = 1
          @flame[index].opacity = index == 0 ? 65 : 0
          @flame[0].zoom_x = 1.5
          @flame[0].zoom_y = @flame[0].zoom_x
      end
  end  
  
  #--------------------------------------------------------------------------
  # ● Create Commands
  #--------------------------------------------------------------------------                
  def create_commands
      @com = []
      for index in 0...3
          @com.push(Title_Commands.new(nil,index))
      end 
  end
  
  #--------------------------------------------------------------------------
  # ● Create Fire Wind
  #--------------------------------------------------------------------------            
  def create_fire_wind
      @fire_wind = []
      @fire_wind_image = Cache.title1("Fire_Wind")
      fire_max = 1
      for index in 0...fire_max
      range = (FIRE_WIND_POWER + 1 + (index * 2)) * 10
      range = 500 if range > 500
      speed = (FIRE_WIND_SPEED + 1 + (index * 2)) * 100 
      speed = 1000 if speed > 1000           
          @fire_wind.push(Sprite.new)
          @fire_wind[index].wave_amp = range
          @fire_wind[index].wave_length = Graphics.width
          @fire_wind[index].wave_speed = speed        
          @fire_wind[index].bitmap = Bitmap.new(Graphics.width + (range * 2),Graphics.height)
          @fire_wind[index].bitmap.stretch_blt(@fire_wind[index].bitmap.rect, @fire_wind_image, @fire_wind_image.rect) 
          @fire_wind[index].z = 1
          @fire_wind[index].x = -range
          @fire_wind[index].blend_type = FIRE_BLEND_TYPE
          @fire_wind[index].opacity = FIRE_OPACITY + (40 * index)
      end
  end  
  
  #--------------------------------------------------------------------------
  # ● Create Particles
  #--------------------------------------------------------------------------  
  def create_particles
      @particles_sprite =[]
      for i in 0...NUMBER_OF_PARTICLES
          @particles_sprite.push(Particles_Title.new(nil))
      end
  end   
  
  #--------------------------------------------------------------------------
  # ● Create Particles
  #--------------------------------------------------------------------------  
  def create_particles2
      @particles_sprite2 =[]
      for i in 0...NUMBER_OF_PARTICLES
          @particles_sprite2.push(Particles_Title2.new(nil))
      end
  end    
  
  #--------------------------------------------------------------------------
  # ● Create Particles
  #--------------------------------------------------------------------------  
  def create_particles3
      @particles_sprite3 =[]
      for i in 0...NUMBER_OF_PARTICLES
          @particles_sprite3.push(Particles_Title3.new(nil))
      end
  end    
  
  #--------------------------------------------------------------------------
  # ● Create Character
  #--------------------------------------------------------------------------    
  def create_character
      @character = Sprite.new
      @character.bitmap = Cache.title1("Character")
      @character.ox = @character.bitmap.width / 2
      @character.oy = @character.bitmap.height / 2
      @character.x = CHARACTER_POSITION[0] + @character.ox
      @character.y = CHARACTER_POSITION[1] + @character.oy
      @character.z = 3
      @character.opacity = 0
      @char_zoom_speed = [0,0,0]
      @character2 = Sprite.new
      @character2.bitmap = Cache.title1("Character2")
      @character2.ox = @character2.bitmap.width / 2
      @character2.oy = @character2.bitmap.height / 2
      @character2.x = CHARACTER_POSITION[0] + @character2.ox
      @character2.y = CHARACTER_POSITION[1] + @character2.oy
      @character2.z = 4      
      @character2.blend_type = 1
      @character2.opacity = 255
      @character2.visible = CHARACTER_AURA_EFFECT
      @character2.zoom_x = 1.0
      @character2.zoom_y = @character2.zoom_x
  end
 
  #--------------------------------------------------------------------------
  # ● Create Aura
  #--------------------------------------------------------------------------      
  def create_aura
      @aura = Sprite.new
      @aura.bitmap = Cache.title1("Aura")
      @aura.ox = @character2.bitmap.width / 2
      @aura.oy = @character2.bitmap.height / 2
      @aura.x = AURA_POSITION[0] + @aura.ox
      @aura.y = AURA_POSITION[1] + @aura.oy
      @aura.z = 2      
      @aura.blend_type = 1
      @aura.opacity = 255
      @aura_zoom_phase = [0,0]
  end
  
end

#==============================================================================
# ■ Particles Title
#==============================================================================
class Particles_Title2 < Sprite
  
  include MOG_MOKOU_TITLE_SCRREN
  
 #--------------------------------------------------------------------------
 # ● Initialize
 #--------------------------------------------------------------------------             
  def initialize(viewport = nil)
      super(viewport)
      @speed_x = 0
      @speed_y = 0
      @speed_a = 0
      @next_pos = [440,190]
      self.bitmap = Cache.title1("Particles2")
      self.blend_type = PARTICLES_BLEND_TYPE 
      self.z = 4
      @cy_size = self.bitmap.height + (self.bitmap.height / 2)
      @cy_limit = Graphics.height + @cy_size
      @rg = [Graphics.width - self.bitmap.width ,0]
      @phase = 0
      reset_setting(true)
  end  
  
 #--------------------------------------------------------------------------
 # ● Reset Setting
 #--------------------------------------------------------------------------               
  def reset_setting(initial = false)
      zoom = (50 + rand(100)) / 100.1
      self.zoom_x = zoom
      self.zoom_y = zoom
      self.x = rand(576) - 160
      self.y = initial == true ? rand(480) : -@cy_size
      @speed_y = (1 + rand(3))
      @speed_x = (1 + rand(2))
      @speed_a = (1 + rand(2))    
      @rg[1] = (Graphics.height / 2) + rand(128)     
      @phase = 0      
  end
  
 #--------------------------------------------------------------------------
 # ● Dispose
 #--------------------------------------------------------------------------               
  def dispose
      super
      self.bitmap.dispose if self.bitmap != nil
  end  
  
 #--------------------------------------------------------------------------
 # ● Update
 #--------------------------------------------------------------------------               
  def update
      super
      if @phase == 0 and self.y < @rg[1] and self.x < @rg[0]
         self.x += @speed_x
         self.y += @speed_y
      else
        @phase = 1
        update_slide(0,@next_pos[0])
        update_slide(1,@next_pos[1])
      end
      self.opacity += 5
      reset_setting if can_reset_setting?
  end  
  
 #--------------------------------------------------------------------------
 # ● Can Reset Setting
 #--------------------------------------------------------------------------                 
  def can_reset_setting?
      return true if self.x == @next_pos[0] and self.y == @next_pos[1]
#      return true if self.opacity <= 1
      return false
  end  

 #--------------------------------------------------------------------------
 # ● Update Slide
 #--------------------------------------------------------------------------                       
  def update_slide(type,np)
      cp = type == 0 ? self.x : self.y
      sp = 2 + ((cp - np).abs / 20)
      if cp > np 
         cp -= sp
         cp = np if cp < np
      elsif cp < np 
         cp += sp
         cp = np if cp > np
      end     
      self.x = cp if type == 0
      self.y = cp if type == 1
  end    
  
end

#==============================================================================
# ■ Particles Title
#==============================================================================
class Particles_Title3 < Sprite
  
  include MOG_MOKOU_TITLE_SCRREN
  
 #--------------------------------------------------------------------------
 # ● Initialize
 #--------------------------------------------------------------------------             
  def initialize(viewport = nil)
      super(viewport)
      @speed_x = 0
      @speed_y = 0
      @speed_a = 0
      @next_pos = [440,190]
      self.bitmap = Cache.title1("Particles3")
      self.blend_type = PARTICLES_BLEND_TYPE 
      self.z = 4
      @cy_size = self.bitmap.height + (self.bitmap.height / 2)
      @cy_limit = Graphics.height + @cy_size
      @rg = [Graphics.width - self.bitmap.width ,0]
      @phase = 0
      reset_setting(true)
  end  
  
 #--------------------------------------------------------------------------
 # ● Reset Setting
 #--------------------------------------------------------------------------               
  def reset_setting(initial = false)
      zoom = (50 + rand(100)) / 100.1
      self.zoom_x = zoom
      self.zoom_y = zoom
      self.x = 440 + rand(self.bitmap.width) # - 160
      self.y = 190 + rand(self.bitmap.height) #initial == true ? rand(480) : -@cy_size
      self.opacity = 255
      @speed_y = (1 + rand(3))
      @speed_x = (1 + rand(2))
      @speed_a = (1 + rand(2))    
      @rg[1] = (Graphics.height / 2) + rand(128)     
      @phase = 0      
  end
  
 #--------------------------------------------------------------------------
 # ● Dispose
 #--------------------------------------------------------------------------               
  def dispose
      super
      self.bitmap.dispose if self.bitmap != nil
  end  
  
 #--------------------------------------------------------------------------
 # ● Update
 #--------------------------------------------------------------------------               
  def update
      super
     # self.x += @speed_x
      self.y -= @speed_y
      self.opacity -= 3
      reset_setting if can_reset_setting?
  end  
  
 #--------------------------------------------------------------------------
 # ● Can Reset Setting
 #--------------------------------------------------------------------------                 
  def can_reset_setting?
      return true if self.y < 0
      return false
  end  
  
end

#==============================================================================
# ■ Particles Title
#==============================================================================
class Particles_Title < Sprite
  
  include MOG_MOKOU_TITLE_SCRREN
  
 #--------------------------------------------------------------------------
 # ● Initialize
 #--------------------------------------------------------------------------             
  def initialize(viewport = nil)
      super(viewport)
      @speed_x = 0
      @speed_y = 0
      @speed_a = 0
      @speed_o = 0
      self.bitmap = Cache.title1("Particles")
      self.blend_type = PARTICLES_BLEND_TYPE 
      self.z = 4
      @cy_size = self.bitmap.height + (self.bitmap.height / 2)
      @cy_limit = Graphics.height - (@cy_size * 3)
      reset_setting(true)
  end  
  
 #--------------------------------------------------------------------------
 # ● Reset Setting
 #--------------------------------------------------------------------------               
  def reset_setting(initial = false)
      zoom = (50 + rand(100)) / 100.1
      self.zoom_x = zoom
      self.zoom_y = zoom
      self.x = rand(Graphics.width)
      self.y = initial == true ? rand(480) : (Graphics.height + @cy_size)
      self.opacity = 255
      z = rand(2)
      if z == 1
         self.z = 40
      else
         self.z = 20
      end
      @speed_y = -(1 + rand(3))
      @speed_x = (1 + rand(2))
      @speed_a = (1 + rand(2))
      @speed_o = (2 + rand(8))
  end
  
 #--------------------------------------------------------------------------
 # ● Dispose
 #--------------------------------------------------------------------------               
  def dispose
      super
      self.bitmap.dispose if self.bitmap != nil
  end  
  
 #--------------------------------------------------------------------------
 # ● Update
 #--------------------------------------------------------------------------               
  def update
      super
      self.y += @speed_y
      self.opacity -= @speed_o
      reset_setting if can_reset_setting?
  end  
  
 #--------------------------------------------------------------------------
 # ● Can Reset Setting
 #--------------------------------------------------------------------------                 
  def can_reset_setting?
      return true if self.opacity == 0
      return true if self.y < -@cy_size
      return false
  end  

end

#==============================================================================
# ■ Title Commands
#==============================================================================
class Title_Commands < Sprite
  include MOG_MOKOU_TITLE_SCRREN
  
  #--------------------------------------------------------------------------
  # ● Initialize
  #--------------------------------------------------------------------------  
  def initialize(viewport = nil,index)
      super(viewport)
      @index = index
      @float = [0,0,0]
      self.bitmap = Cache.title1("Command" + index.to_s)
      self.ox = self.bitmap.width / 2
      self.oy = self.bitmap.height / 2 
      @org_pos = [COMMAND_POSITION[0] + self.ox,
        COMMAND_POSITION[1] + self.oy + (self.bitmap.height + 2) * index,
        self.ox - 24]
      self.x = @org_pos[0] - self.bitmap.width - (self.bitmap.width * index)
      self.y = @org_pos[1]
      self.z = 25
      @next_pos = [@org_pos[0],@org_pos[1]]
  end
  
  #--------------------------------------------------------------------------
  # ● Dispose
  #--------------------------------------------------------------------------  
  def dispose_sprites
      self.bitmap.dispose
  end
  
  #--------------------------------------------------------------------------
  # ● Update
  #--------------------------------------------------------------------------              
  def update_sprites(index,active)
     # return if !active 
      if index == @index
         self.opacity += 10 
         @next_pos[0] = @org_pos[0]
        # update_float_effect   
      else
         self.opacity -= 10 if self.opacity > 120
         @next_pos[0] = @org_pos[2]
         @float = [0,0,0]
      end  
      update_slide(0,@next_pos[0])
      update_slide(1,@org_pos[1] + @float[0])
  end
  
 #--------------------------------------------------------------------------
 # ● Update Slide
 #--------------------------------------------------------------------------                       
  def update_slide(type,np)
      cp = type == 0 ? self.x : self.y
      sp = 3 + ((cp - np).abs / 10)
      if cp > np 
         cp -= sp
         cp = np if cp < np
      elsif cp < np 
         cp += sp
         cp = np if cp > np
      end     
      self.x = cp if type == 0
      self.y = cp if type == 1
  end     
  
  #--------------------------------------------------------------------------
  # ● Update Float Effect
  #--------------------------------------------------------------------------                
  def update_float_effect
      @float[2] += 1
      return if @float[2] < 5
      @float[2] = 0
      @float[1] += 1
      case @float[1]
           when 1..5
               @float[0] -= 1
           when 6..15   
               @float[0] += 1
           when 16..20  
               @float[0] -= 1
           else  
               @float[0] = 0
               @float[1] = 0
      end
  end
  
end

#==============================================================================
# ■ Scene Title
#==============================================================================
class Scene_Title
  
  #--------------------------------------------------------------------------
  # ● Dispose
  #--------------------------------------------------------------------------          
  def dispose
      Graphics.freeze
      dispose_background
      dispose_fire_wind
      dispose_particles
      dispose_particles2
      dispose_particles3
      dispose_flame
      dispose_character
      dispose_aura
      dispose_layout
      dispose_commands
  end
    
  #--------------------------------------------------------------------------
  # ● Dispose Background
  #--------------------------------------------------------------------------            
  def dispose_background
      @background.bitmap.dispose
      @background.dispose      
  end
  
  #--------------------------------------------------------------------------
  # ● Dispose Layout
  #--------------------------------------------------------------------------              
  def dispose_layout  
      @layout.bitmap.dispose
      @layout.dispose
  end  
    
  #--------------------------------------------------------------------------
  # ● Dispose Commands
  #--------------------------------------------------------------------------                
  def dispose_commands
      @com.each {|sprite| sprite.dispose_sprites }
  end  
  
  #--------------------------------------------------------------------------
  # ● Dispose Skulls
  #--------------------------------------------------------------------------                
  def dispose_skulls
      @skulls.each {|sprite| sprite.dispose_sprites }
  end   
  
  #--------------------------------------------------------------------------
  # ● Dispose Fire Wind
  #--------------------------------------------------------------------------            
  def dispose_fire_wind
      @fire_wind.each {|sprite| sprite.bitmap.dispose }
      @fire_wind.each {|sprite| sprite.dispose }
      @fire_wind_image.dispose
  end
  
 #--------------------------------------------------------------------------
 # ● Dispose Particles
 #--------------------------------------------------------------------------    
 def dispose_particles
     @particles_sprite.each {|sprite| sprite.dispose }
 end    
  
 #--------------------------------------------------------------------------
 # ● Dispose Particles 2
 #--------------------------------------------------------------------------    
 def dispose_particles2
     @particles_sprite2.each {|sprite| sprite.dispose }
 end   
 
 #--------------------------------------------------------------------------
 # ● Dispose Particles 3
 #--------------------------------------------------------------------------    
 def dispose_particles3
     @particles_sprite3.each {|sprite| sprite.dispose }
 end   
 
 #--------------------------------------------------------------------------
 # ● Dispose Flame
 #--------------------------------------------------------------------------    
 def dispose_flame
     @flame.each {|sprite| sprite.dispose }
 end    
 
  #--------------------------------------------------------------------------
  # ● Dispose Character
  #--------------------------------------------------------------------------    
  def dispose_character
      @character.bitmap.dispose
      @character.dispose
      @character2.bitmap.dispose
      @character2.dispose      
  end    
 
  #--------------------------------------------------------------------------
  # ● Dispose Aura
  #--------------------------------------------------------------------------    
  def dispose_aura
      @aura.bitmap.dispose
      @aura.dispose
 end      
  
end

#==============================================================================
# ■ Scene Title
#==============================================================================
class Scene_Title
  
  #--------------------------------------------------------------------------
  # ● Update Sprites
  #--------------------------------------------------------------------------          
  def update_sprites
      update_background
      update_fire_wind
      update_particles
      update_particles2
      update_particles3
      update_character
      update_commands
      update_aura
      update_flame
  end
    
  #--------------------------------------------------------------------------
  # ● Update Background
  #--------------------------------------------------------------------------            
  def update_background
      @layout.opacity += 5
      @background_scroll[2] += 1
      return if @background_scroll[2] < 4
      @background_scroll[2] = 0
      @background.ox += @background_scroll[0]
      @background.oy += @background_scroll[1]
  end  
  
  #--------------------------------------------------------------------------
  # ● Update Commands
  #--------------------------------------------------------------------------                
  def update_commands
      @com.each {|sprite| sprite.update_sprites(@com_index,@active)}
  end      
  
  #--------------------------------------------------------------------------
  # ● Update Fire Wind
  #--------------------------------------------------------------------------            
  def update_fire_wind
      @fire_wind.each {|sprite| sprite.update }
  end    
  
  #--------------------------------------------------------------------------
  # ● Update Particles
  #--------------------------------------------------------------------------  
  def update_particles
      @particles_sprite.each {|sprite| sprite.update }
  end  
  
  #--------------------------------------------------------------------------
  # ● Update Particles 2
  #--------------------------------------------------------------------------  
  def update_particles2
      @particles_sprite2.each {|sprite| sprite.update }
  end    
  
  #--------------------------------------------------------------------------
  # ● Update Particles 3
  #--------------------------------------------------------------------------  
  def update_particles3
      @particles_sprite3.each {|sprite| sprite.update }
  end   
  
  #--------------------------------------------------------------------------
  # ● Update Aura
  #--------------------------------------------------------------------------    
  def update_aura
      if @aura_zoom_phase[0] == 0
         @aura.zoom_x += 0.001
         if @aura.zoom_x > 1.10
            @aura_zoom_phase[0] = 1
            @aura.zoom_x = 1.10
         end
      else
         @aura.zoom_x -= 0.001
         if @aura.zoom_x < 1.00
            @aura_zoom_phase[0] = 0
            @aura.zoom_x = 1.00
         end         
         
      end  
      @aura.zoom_y = @aura.zoom_x
  end
      
  #--------------------------------------------------------------------------
  # ● Update Character
  #--------------------------------------------------------------------------    
  def update_character
      @character.opacity += 5
      @char_zoom_speed[0] += 1
      case @char_zoom_speed[0]
         when 1..60
           @char_zoom_speed[2] += 2
         when 61..120
           @char_zoom_speed[2] -= 2
         else  
         @char_zoom_speed[0] = 0
         @char_zoom_speed[2] = 0
      end
      @character2.opacity = 135 + @char_zoom_speed[2]
  end
  
  #--------------------------------------------------------------------------
  # ● Update Flame
  #--------------------------------------------------------------------------      
  def update_flame
      @flame[0].opacity += 5 if @flame[0].opacity < 65
      @flame[1].opacity -= 1
      @flame[1].zoom_x += 0.01
      if @flame[1].opacity == 0
         @flame[1].opacity = 120 
         @flame[1].zoom_x = 1.00
      end
      @flame[1].zoom_y = @flame[1].zoom_x
      
      @flame[2].opacity -= 1
      @flame[2].zoom_x += 0.01
      if @flame[2].opacity == 0
         @flame[2].opacity = 250 
         @flame[2].zoom_x = 1.00
      end
      @flame[2].zoom_y = @flame[2].zoom_x      
      
  end
  
end

#==============================================================================
# ■ Scene Title
#==============================================================================
class Scene_Title
  
  #--------------------------------------------------------------------------
  # ● Update
  #--------------------------------------------------------------------------          
  def update
      update_command
      update_sprites
  end
    
end

#==============================================================================
# ■ Scene Title
#==============================================================================
class Scene_Title
  
  #--------------------------------------------------------------------------
  # ● Update Command
  #--------------------------------------------------------------------------          
  def update_command
      update_key
      refresh_index if @com_index_old != @com_index
  end
    
  #--------------------------------------------------------------------------
  # ● Update Key
  #--------------------------------------------------------------------------            
  def update_key
      if Input.trigger?(:DOWN)
         add_index(1) 
      elsif Input.trigger?(:UP)
         add_index(-1)
      elsif Input.trigger?(:C)  
         select_command
      end  
  end
  
  #--------------------------------------------------------------------------
  # ● Select Command
  #--------------------------------------------------------------------------              
  def select_command
    #  if !@active
    #     @active = true  
    #     return
    #  end  
      case @com_index
         when 0; command_new_game
         when 1; command_continue
         when 2; command_shutdown  
      end
  end
  
  #--------------------------------------------------------------------------
  # ● Add Index
  #--------------------------------------------------------------------------              
  def add_index(value = 0)
      @com_index += value
      if !@continue_enabled and @com_index == 1
          @com_index = 2 if value == 1
          @com_index = 0 if value == -1
      end    
      @com_index = 0 if @com_index > @com_index_max
      @com_index = @com_index_max if @com_index < 0
  end
  
  #--------------------------------------------------------------------------
  # ● Refresh Index
  #--------------------------------------------------------------------------            
  def refresh_index
      @com_index_old = @com_index
      Sound.play_cursor
  end
  
  #--------------------------------------------------------------------------
  # ● Command New Game
  #--------------------------------------------------------------------------            
  def command_new_game    
      Sound.play_ok
      DataManager.setup_new_game
      fadeout_all
      $game_map.autoplay
      SceneManager.goto(Scene_Map)      
  end  

  #--------------------------------------------------------------------------
  # ● Command Continue
  #--------------------------------------------------------------------------            
  def command_continue
      if !@continue_enabled
         Sound.play_cancel
         return
      else   
         Sound.play_ok
      end  
      SceneManager.call(Scene_Load)
  end    
  
  #--------------------------------------------------------------------------
  # ● Command Shutdown
  #--------------------------------------------------------------------------            
  def command_shutdown
      Sound.play_ok
      fadeout_all
      SceneManager.exit    
  end
  
  #--------------------------------------------------------------------------
  # ● play_title_music
  #--------------------------------------------------------------------------
  def play_title_music
      $data_system.title_bgm.play
      RPG::BGS.stop
      RPG::ME.stop
  end  
  
  #--------------------------------------------------------------------------
  # ● Fadeout_all
  #--------------------------------------------------------------------------
  def fadeout_all(time = 1000)
      RPG::BGM.fade(time)
      RPG::BGS.fade(time)
      RPG::ME.fade(time)
      Graphics.fadeout(time * Graphics.frame_rate / 1000)
      RPG::BGM.stop
      RPG::BGS.stop
      RPG::ME.stop
  end  
  
end

$mog_rgss3_mokou_title_screen = true



 






Code:
I am thankful for every help :)!
 

Latest Threads

Latest Posts

Latest Profile Posts

grief... finding a font that works with the engine has been a bigger process than I thought it'd be. doesn't help MV loves to scrunch letters next to each other like a football huddle.
The new Phoenix plugin. I drew icons and an interface into it
R3-M1 can now leave footprints :kaojoy: Thanks Dsiver144 for another amazing plugin!!

1653686110642.png

Hey guys, do you wanna see who dominated the competition in our last game jam?! Stop by while we play Pinky by @Wumbohek Starting at 4:20pm EST.

Forum statistics

Threads
122,181
Messages
1,147,061
Members
160,447
Latest member
1213737577
Top