Inscrit le: 11 Jan 2011, 19:34 Messages: 11 Sexe: Masculin Points d'aide: 0/60
Créations :
Voir ses créations
|
Voici un script pour afficher la vie, avec beaucoup d'option : Auteur : Moi Les images : ( Les images ci dessous sont a mettre dans le dossier system ) A appeler "HP" : http://img231.imageshack.us/i/56360412.png/A appeler "MP" http://img197.imageshack.us/i/88392122.png/A appeler "Fond_barre" : http://img35.imageshack.us/i/fondbarreh.png/A appeler "HUD_FOND" : http://img195.imageshack.us/i/hudfond.png/Faite en sorte que cette image soit transparente ( clic gauche sur le rouge et clic droit sur le noir ) Les scripts : Script explication (facultatif) : Script module (obligatoire pour le bon fonctionnement) : Et enfin le script en lui même ( bien sûr obligatoire ... ) : - Code: Tout sélectionner
#================================================== # ~ Script Vie ~ | v 1.0 | by Loupblanc #==================================================
#---------------------------------------------------------- class Scene_Map #---------------------------------------------------------- alias hud_start start alias hud_update update alias hud_terminate terminate include Vie
def start @win_Vie = Window_Life.new hud_start end def update if $game_switches[Vie::SWITCH_ACTIVE] == true @win_Vie.visible = true $game_map.refresh else @win_Vie.visible = false $game_map.refresh end hud_update end def terminate @win_Vie.dispose hud_terminate end end
# ~ Fin de la scène map ! ~
#---------------------------------------------------------- class Window_Life < Window_Base #---------------------------------------------------------- include Vie
def initialize super (0, 0, 265, 140) self.opacity = Vie::FENTRE_ACTIVE refresh end
def refresh @hero = $game_party.members[0] hp_text = Vocab::hp_a hp = @hero.hp mp_text = Vocab::mp_a mp = @hero.mp self.contents.clear if Vie::FOND_ACTIVE == true draw_fond(0, 0, 160) end
self.contents.font.color = normal_color if Vie::CLASS_ACTIVE == true draw_actor_class(@hero, 156, 0) end draw_actor_face(@hero, 0, 0) draw_actor_name(@hero, 96, 0) draw_actor_hp_gauge(@hero, 96, 20,128) draw_actor_mp_gauge(@hero, 96, 40, 128) if Vie::LEVEL_ACTIVE == true draw_actor_level(@hero, 20, 0) end
if Vie::EXP_ACTIVE == true self.contents.font.size = 20 self.contents.draw_text(100, 55, 115, 24, "exp"+" "+":", 0) self.contents.font.size = 16 draw_actor_exp_info(@hero, 20, 75, 0) end self.contents.font.size = 16 self.contents.draw_text(136, 18, 115, 24, hp_text, 0) self.contents.draw_text(158, 18, 115, 24, hp, 0) self.contents.draw_text(136, 38, 115, 24, mp_text, 0) self.contents.draw_text(158, 38, 115, 24, mp, 0) end
#----------------------------------------------------------
def draw_actor_hp_gauge(actor, x, y, width = 120) fond = Cache.system("Fond_barre") barre = Cache.system("HP") self.contents.blt(x, y, fond, fond.rect) built = Rect.new(0, 0, fond.width * actor.hp / actor.maxhp, fond.height) self.contents.blt(x, y, barre, built) end def draw_actor_mp_gauge(actor, x, y, width = 120) fond = Cache.system("Fond_barre") barre = Cache.system("MP") self.contents.blt(x, y, fond, fond.rect) built = Rect.new(0, 0, fond.width * actor.mp / actor.maxmp, fond.height) self.contents.blt(x, y, barre, built) end def draw_actor_exp_info(actor, x, y, width = 120) s1 = actor.exp_s s2 = actor.next_rest_exp_s s_next = sprintf(Vocab::level_a) self.contents.font.color = normal_color self.contents.draw_text(x+WLH+55, y , 180, WLH, s1, 0) self.contents.draw_text(x+WLH+115,y,180,WLH,"/",0) self.contents.draw_text(x+WLH+125,y,180,WLH,(s2+s1),0) end def draw_fond(x, y, widht = 160) hud_new = Cache.system("HUD_FOND") self.contents.blt(x, y, hud_new, hud_new.rect) end
end
# ~ Fin de la scène Life ! ~
#================================================== # Fin du script ! #==================================================
Si il y a des points à amélioré dites-le moi s'en hésité ( surtout pour l'orthographe ... )! A et puis le screen : > ici <Merci :byebye:
_________________ _________________________________________ Loupblanc, Graphiste
|
|