Final Fantasy RPG Maker

Jour et Nuit

Auteur : Pikaball ?

Source : http://rpgmaker-xp-leclan.keuf.net/rpg-maker-xp-c2/Scripts-f5/Le-jour-et-la-nuit-t14.htm

Utilisation : Affiche en bas à gauche de l'écran, l'heure et le jour de votre ordinateur. Un effet nuit s'active quand il est tard (l'écran s'assombrit), suivant l'heure de votre ordinateur.

Screen :

Jour_nuit_1.jpg
(vue 3482 fois)

Jour_nuit_2.jpg
(vue 3480 fois)



Installation : Insérer le script suivant au -dessus de main, avec le nom que vous voulez

class Jour_heure < Window_Base
def initialize
super(440, 420, 200, 60)
self&#46;contents = Bitmap&#46;new(width - 32, height - 32)
self&#46;contents&#46;font&#46;name = $fontface
self&#46;contents&#46;font&#46;size = $fontsize
self&#46;opacity = 150
@heure = 0
@ext_ton = true
self&#46;visible = true
$exterieur = true
refresh
end
def refresh
if Input&#46;trigger?(Input&#58;&#58;L)
self&#46;visible = ! self&#46;visible
end
@horloge = Time&#46;new
@seconde = @horloge&#46;sec * Graphics&#46;frame_rate
self&#46;contents&#46;clear
case @horloge&#46;strftime("%A")
when "Monday"
jour = "Lundi"
when "Tuesday"
jour = "Mardi"
when "Wednesday"
jour = "Mercredi"
when "Thursday"
jour = "Jeudi"
when "Friday"
jour = "Vendredi"
when "Saturday"
jour = "Samedi"
when "Sunday"
jour = "Dimanche"
end
text = sprintf("%02d&#58;%02d&#58;%02d ",@horloge&#46;hour, @horloge&#46;min, @horloge&#46;sec)
self&#46;contents&#46;draw_text(0, 0, 200, 24,text + jour)
@map = load_data(sprintf("Data/Map%03d&#46;rxdata", $game_map&#46;map_id))
end
def update
refresh
if @heure != @horloge&#46;hour or @ext_ton != $exterieur
@ext_ton = $exterieur
@heure = @horloge&#46;hour
changement_ton
end
end
def changement_ton
if $exterieur
case @horloge&#46;hour
when 0
@tone = Tone&#46;new(-100, -100, -100, 0)
$game_screen&#46;start_tone_change(@tone,10)
when 1
@tone = Tone&#46;new(-100, -100, -100, 0)
$game_screen&#46;start_tone_change(@tone,10)
when 2
@tone = Tone&#46;new(-100, -100, -100, 0)
$game_screen&#46;start_tone_change(@tone,10)
when 3
@tone = Tone&#46;new(-90, -90, -90, 0)
$game_screen&#46;start_tone_change(@tone,10)
when 4
@tone = Tone&#46;new(-80, -80, -80, 0)
$game_screen&#46;start_tone_change(@tone,10)
when 5
@tone = Tone&#46;new(-60, -60, -60, 0)
$game_screen&#46;start_tone_change(@tone,10)
when 6
@tone = Tone&#46;new(-30, -30, -30, 0)
$game_screen&#46;start_tone_change(@tone,10)
when 7
@tone = Tone&#46;new(0, 0, 0, 0)
$game_screen&#46;start_tone_change(@tone,10)
when 8
@tone = Tone&#46;new(0, 0, 0, 0)
$game_screen&#46;start_tone_change(@tone,10)
when 9
@tone = Tone&#46;new(0, 0, 0, 0)
$game_screen&#46;start_tone_change(@tone,10)
when 10
@tone = Tone&#46;new(0, 0, 0, 0)
$game_screen&#46;start_tone_change(@tone,10)
when 11
@tone = Tone&#46;new(10, 10, 10, 0)
$game_screen&#46;start_tone_change(@tone,10)
when 12
@tone = Tone&#46;new(10, 10, 10, 0)
$game_screen&#46;start_tone_change(@tone,10)
when 13
@tone = Tone&#46;new(10, 10, 10, 0)
$game_screen&#46;start_tone_change(@tone,10)
when 14
@tone = Tone&#46;new(10, 10, 10, 0)
$game_screen&#46;start_tone_change(@tone,10)
when 15
@tone = Tone&#46;new(10, 10, 10, 0)
$game_screen&#46;start_tone_change(@tone,10)
when 16
@tone = Tone&#46;new(50, 20, 10, 0)
$game_screen&#46;start_tone_change(@tone,10)
when 17
@tone = Tone&#46;new(50, 30, 10, 0)
$game_screen&#46;start_tone_change(@tone,10)
when 18
@tone = Tone&#46;new(50, 40, 10, 0)
$game_screen&#46;start_tone_change(@tone,10)
when 19
@tone = Tone&#46;new(-5, -5, -5, 0)
$game_screen&#46;start_tone_change(@tone,10)
when 20
@tone = Tone&#46;new(-20, -20, -20, 0)
$game_screen&#46;start_tone_change(@tone,10)
when 21
@tone = Tone&#46;new(-40, -40, -40, 0)
$game_screen&#46;start_tone_change(@tone,10)
when 22
@tone = Tone&#46;new(-60, -60, -60, 0)
$game_screen&#46;start_tone_change(@tone,10)
when 23
@tone = Tone&#46;new(-80, -80, -80, 0)
$game_screen&#46;start_tone_change(@tone,10)
end
else
@tone = Tone&#46;new(0, 0, 0, 0)
$game_screen&#46;start_tone_change(@tone,10)
end
end
end
 
class Scene_Save
 
alias old_write_save_data write_save_data
 
def write_save_data(file)
 
old_write_save_data(file)
Marshal&#46;dump($exterieur, file)
end
 
end
 
class Scene_Load
 
alias old_read_save_data read_save_data
 
def read_save_data(file)
old_read_save_data(file)
$exterieur = Marshal&#46;load(file)
end
 
end
class Scene_Map
 
alias old_main main
def main
@jh = Jour_heure&#46;new
old_main
@jh&#46;dispose
end
 
alias old_update update
def update
@jh&#46;update
old_update
end
 
end


EDIT : Modifier avec la balise Code
Amathlog



Ajouté par Shaolan
le 02/07/2007 à 12:12:57
Vu 6425 fois





Commentaires

Page: 1


Fredy123 a écrit:

Il en fonctionne pas... dommage... :(

&quot;Erreur syntaxe&quot;

Message posté le 05/08/2011 à 07:15:14 IP: 24.203.125.171


10/10

Oli-link a écrit:

Wow!!! il marche super bien!! 10/10

Message posté le 09/05/2010 à 18:45:42 IP: 24.203.232.24


Page générée en 0.0001 secondes
©2011 Site créé par Martial, le Webmaster
Me contacter - Livre d'or - Forum - Plan du site
Mentions légales - Remerciements
Final-RPG