

Voila un petit scripts pour ceux qui veulent faire une intro avant l'écran titre (l'écran ou on choisis une nouvelle partie)
Tout dabord creer un nouveau scrîpt au dessus de main nommé [Scene_Intro]
#=================================
#Scene_Intro
#------------------------------------------------------------------
#Les images doivent etres mise dans le dossier pictures
#=================================
class Scene_Intro
#-----------------------------------------------------------------
def main
$data_system = load_data("Data/System.rxdata")
$game_system = Game_System.new
@start_time = Time.now
#---------------------------------
pictures=["Arshes", "Basil", "Sirus", "Estelle", "Felix", "Gloria", "Hilda"]
@pic_start_array=[1,3,4,14,23,29,80]
@pic_end_array=[5,7,10,22,32,38,90]
#---------------------------------
x_list=[0,300,50,0,0,0,0]
#------------------------------------
y_list=[50,250,350,0,0,0,0]
#ici la vitesse a laquelle les images dispraissent en fondu
@fade_in_speed=[1,1,1,5,1,2,1]
@pic_array=Array.new
for i in 0...pictures.size
sprite=Sprite.new
sprite.bitmap=RPG::Cache.picture("" + pictures[i])
sprite.opacity=0
sprite.x=x_list[i]
sprite.y=y_list[i]
sprite.z=9997
@pic_array[i]=sprite
end
strings=["put string list here"]
@win=Window_Base.new(0,480,640,64 * strings.size )
@win.contents=Bitmap.new(@win.width-32,@win.height-32)
@win.contents.font.name="Bookman Old Style"
@win.contents.font.size=28
@win.opacity=0
@win.z=9998
@win.contents.font.color=Color.new(234,236,147,200)
for i in 0...strings.size
cw=@win.contents.text_size(strings[i]).width
@win.contents.draw_text(@win.contents.width/2 - cw/2,64*i,cw,32,strings[i])
end
@skip_enabled = false
for i in 0..3
if FileTest.exist?("Save#{i+1}.sav")
@skip_enabled = true
end
end
if $DEBUG
@skip_enabled=true
end
#----------------------------
Audio.bgm_play("Audio/BGM/Kaze No Ne (E)", 150, 100)
Graphics.transition
@go_to_title=false
@every_other=0
loop do
if @go_to_title
break
end
Graphics.update
Input.update
$game_system.update
update
end
Graphics.freeze
for i in 0...@pic_array.size
@pic_array[i].dispose
end
@win.dispose
$scene=Scene_Title.new
end
#-----------------------------------------------------------------
def update
if Input.trigger?(Input::C) and @skip_enabled
$game_system.se_play($data_system.cancel_se)
@go_to_title= true
end
if Time.now >= @start_time + 85
@go_to_title = true
end
if Time.now <= @start_time + 38 or Time.now >= @start_time +77
phase_1
end
if Time.now >= @start_time + 33
phase_2
end
end
#-----------------------------------------------------------------
def phase_1
for i in 0...@pic_array.size
time = Time.now - @start_time
if time >= @pic_start_array[i] and time <= @pic_end_array[i]
@pic_array[i].opacity +=@fade_in_speed[i]
else
@pic_array[i].opacity -= @fade_in_speed[i]
end
end
end
#-----------------------------------------------------------------
def phase_2
@every_other+=1
if @every_other % 2 ==1
@win.y -= 1
end
end
end # Scene_Intro
Puis allez dans Main et metter a la place de "Scene_title","Sene_Intro"
Utilisation
Ligne 15:Spécifier le nom des imagesNOTE:Les images doivent etre mise dans le dossier "pictures"
Auteur: Danny Coulombe
Créé le: 2007-12-15 22:43:01
Cette page a été vues: 3429 fois