Trabounet Artisan
Messages : 119 Date d'inscription : 02/01/2008 Age : 29 Localisation : ...
Point Activité: (1000/1000) Point d'aide: (1000/1000)
| Sujet: [Ecran] Barre de vie Sam 23 Fév - 0:19 | |
| POST DE NINJATSU YUMIVoici un super script que j'ai vu sur un autre site ( donc qui n'est pas de moi ) mais que j'ai un peu modifié . ( Je crois qu'il n'est pas deja sur le site ) Créez le au dessu de Main et nommez le "Scene_Map" Voila le script : - Code:
-
#----------------------------------------------------------------- class Scene_Map #----------------------------------------------------------------- alias sk_bar_main main def main @bars = Window_Sk_Bars.new sk_bar_main @bars.dispose if @bars != nil end #----------------------------------------------------------------- alias sk_bar_update update def update @bars.update sk_bar_update end #----------------------------------------------------------------- end #----------------------------------------------------------------- class Window_Base < Window #----------------------------------------------------------------- def sk_initialize(font=0,size=22) font = "Ravenscroft" if font == 0 self.contents = Bitmap.new(self.width-32,self.height-32) self.contents.font.name = font self.contents.font.size = size end #----------------------------------------------------------------- def draw_text_outline(x,y,w,h,str,c=normal_color,a=0) self.contents.font.color = Color.new(0,0,0,255) self.contents.draw_text(x-1,y,w,h,str,a) self.contents.draw_text(x+1,y,w,h,str,a) self.contents.draw_text(x,y+1,w,h,str,a) self.contents.draw_text(x,y-1,w,h,str,a) self.contents.font.color = c self.contents.draw_text(x,y,w,h,str,a) end #----------------------------------------------------------------- end #----------------------------------------------------------------- class Window_Sk_Bars < Window_Base #----------------------------------------------------------------- def initialize super(50,-8,206,96) sk_initialize("Ravenscroft") self.opacity = 0 end #----------------------------------------------------------------- def update self.contents.clear actor = $game_party.actors[0] draw_actor_hp(actor,40,16) draw_actor_sp(actor,30,-16) end #----------------------------------------------------------------- def draw_actor_hp(actor,x,y) width = 128 y += 4 white = Color.new(0,0,0,255) black = Color.new(0,0,0,255) w = width * actor.hp / actor.maxhp # White border self.contents.fill_rect(x+1, y-1, width-2, 1, white) self.contents.fill_rect(x, y, width, 1, white) self.contents.fill_rect(x-1, y+1, width+2, 9, white) self.contents.fill_rect(x, y+10, width, 1, white) self.contents.fill_rect(x+1, y+11, width-2, 1, white) # Black back self.contents.fill_rect(x+2, y, width-4, 1, black) self.contents.fill_rect(x+1, y+1, width-2, 1, black) self.contents.fill_rect(x, y+2, width, 7, black) self.contents.fill_rect(x+1, y+9, width-2, 1, black) self.contents.fill_rect(x+2, y+10, width-4, 1, black) # Generating the color val = 255 * ((actor.hp*100)/actor.maxhp) green = 255 - val/100 color = Color.new(42,237,35,255) w_color = Color.new(132,245,129,255) if green > 64 then green -= 32 elsif green > 128 then green -= 64 end b_color = Color.new(42,237,35,255) # Making the bar self.contents.fill_rect(x+2, y, w-4, 1, w_color) self.contents.fill_rect(x+1, y+1, w-2, 1, w_color) self.contents.fill_rect(x, y+2, w, 7, color) self.contents.fill_rect(x+1, y+9, w-2, 1, color) self.contents.fill_rect(x+2, y+10, w-4, 1, b_color) end #----------------------------------------------------------------- #----------------------------------------------------------------- def draw_actor_sp(actor,x,y) width = 128 y += 20 white = Color.new(0,0,0,255) black = Color.new(0,0,0,255) w = width * actor.sp / actor.maxsp # White border self.contents.fill_rect(x+1, y-1, width-2, 1, white) self.contents.fill_rect(x, y, width, 1, white) self.contents.fill_rect(x-1, y+1, width+2, 9, white) self.contents.fill_rect(x, y+10, width, 1, white) self.contents.fill_rect(x+1, y+11, width-2, 1, white) # Black back self.contents.fill_rect(x+2, y, width-4, 1, black) self.contents.fill_rect(x+1, y+1, width-2, 1, black) self.contents.fill_rect(x, y+2, width, 7, black) self.contents.fill_rect(x+1, y+9, width-2, 1, black) self.contents.fill_rect(x+2, y+10, width-4, 1, black) # Generating the color val = 255 * ((actor.sp*100)/actor.maxsp) blue = - val/100 color = Color.new(62,102,248,252) w_color = Color.new(85,102,239,255) if blue > 64 then blue -= 32 elsif blue > 128 then blue -= 64 end b_color = Color.new(62,102,248,252) # Making the bar self.contents.fill_rect(x+2, y, w-4, 1, w_color) self.contents.fill_rect(x+1, y+1, w-2, 1, w_color) self.contents.fill_rect(x, y+2, w, 7, color) self.contents.fill_rect(x+1, y+9, w-2, 1, color) self.contents.fill_rect(x+2, y+10, w-4, 1, b_color) end #----------------------------------------------------------------- end #----------------------------------------------------------------- | |
|