Menu
Eclipso logo
Merry Christmas !
20/04/2024 00:29:28

Everydayyyyy, Girl's Day ! - Bibi/Ssozi

CE HUD script (RMXP)

kasbak

Débutôt
kasbak
  • Messages : 23

CE HUD script (RMXP)


dim. 18 janv. 2015 - 14h54

Je post mon script sur le system actuel que je fais (je sais pas si c'est la bonne rubrique mais bon^^),ça pourra peu etre servir un jour à quelqu'un d'autres (ou si je le perds)en plus c'est facilement modifiable. Le script affiche donc 4 jauges,sommeil,Faim,Hygiène et WC. Le script originel de la jauge à été fait par "AcedentProne". Image: [spoiler="Screen"][img]http://ahp.li/a8120d10eff6dad20d32.png[/img][/spoiler] [spoiler="Script"] [code]#CE HUD by Kasbak# #use system Gradient Bars #By AcedentProne class Window_Base def draw_normal_barz(x, y, type, length, thick, e1, e2, c1 = Color.new(255,0,0,255), c2 = Color.new(0,0,0,255)) if type == "horizontal" width = length height = thick self.contents.fill_rect(x-1, y - 1, width+2, height + 3, Color.new(255, 255, 255, 255)) self.contents.fill_rect(x, y, width, height + 1, Color.new(0, 0, 0, 255)) w = width * e1 / e2 for i in 0..height r = c1.red + (c2.red - c1.red) * (height -i)/height + 0 * i/height g = c1.green + (c2.green - c1.green) * (height -i)/height + 0 * i/height b = c1.blue + (c2.blue - c1.blue) * (height -i)/height + 0 * i/height a = c1.alpha + (c2.alpha - c1.alpha)* (height -i)/height + 255 * i/height self.contents.fill_rect(x, y+i, w, 1, Color.new(r, g, b, a)) end elsif type == "vertical" width = thick height = length self.contents.fill_rect(x-1, y - 1, width+3, height + 2, Color.new(255, 255, 255, 255)) self.contents.fill_rect(x, y, width+1, height , Color.new(0, 0, 0, 255)) h = height * e1 / e2 for i in 0..width r = c1.red + (c2.red - c1.red) * (width -i)/width + 0 * i/width g = c1.green + (c2.green - c1.green) * (width -i)/width + 0 * i/width b = c1.blue + (c2.blue - c1.blue) * (width -i)/width + 0 * i/width a = c1.alpha + (c2.alpha - c1.alpha)* (width -i)/width + 255 * i/width self.contents.fill_rect(x+i, y, 1, h, Color.new(r, g, b, a)) end end end #pour changer la couleur d'interieur def draw_actor_barz(actor,x, y, type, length, thick, e1, e2, c1 = Color.new(255,255,0,255), c2 = Color.new(255,255,255,255))#couelru 2 verti if type == "horizontal" width = length height = thick self.contents.fill_rect(x-1, y - 1, width+2, height + 3, Color.new(252, 220, 18, 255)) # contour self.contents.fill_rect(x, y, width, height + 1, Color.new(155, 155, 100, 255))#couleur du fond w = width * e1 / e2 for i in 0..height r = c1.red + (c2.red - c1.red) * (height -i)/height + 0 * i/height g = c1.green + (c2.green - c1.green) * (height -i)/height + 0 * i/height b = c1.blue + (c2.blue - c1.blue) * (height -i)/height + 0 * i/height a = c1.alpha + (c2.alpha - c1.alpha)* (height -i)/height + 255 * i/height self.contents.fill_rect(x, y+i, w, 1, Color.new(r, g, b, a)) end elsif type == "vertical" width = thick height = length self.contents.fill_rect(x-1, y - 1, width+3, height + 2, Color.new(255, 255, 255, 255)) self.contents.fill_rect(x, y, width+1, height , Color.new(0, 0, 0, 255)) h = height * e1 / e2 for i in 0..width r = c1.red + (c2.red - c1.red) * (width -i)/width + 0 * i/width g = c1.green + (c2.green - c1.green) * (width -i)/width + 0 * i/width b = c1.blue + (c2.blue - c1.blue) * (width -i)/width + 0 * i/width a = c1.alpha + (c2.alpha - c1.alpha)* (width -i)/width + 255 * i/width self.contents.fill_rect(x+i, y, 1, h, Color.new(r, g, b, a)) end end end end class Scene_Progress #--------------------------------------------------------------------------------- def initialize end #--------------------------------------------------------------------------------- def main @window1 = Window_Progress.new @window1.x =160#160 @window1.y =200#200 @window1.height =100 #100 @window1.width = 341#341 #@window1.z = 200 opacity = 0 Graphics.transition loop do Graphics.update Input.update if Input.trigger?(Input::B) # キャンセル SE を演奏 $game_system.se_play($data_system.cancel_se) # マップ画面に切り替え @sprite = Sprite.new @sprite.bitmap = RPG::Cache.panorama("", 0) $scene = Scene_Menu.new end #update if $scene != self break end end Graphics.freeze @window1.dispose end #--------------------------------------------------------------------------------- #--------------------------------------------------------------------------------- def update end #--------------------------------------------------------------------------------- end class Window_Progress < Window_Base #--------------------------------------------------------------------------------- def initialize super(380, 411, 500,100)#(0, 0, 341,100) self.contents = Bitmap.new(width - 50, height - 32) self.contents.font.name = "Tahoma" self.contents.font.size = 24 self.contents.font.color = text_color(0) self.contents.draw_text(-80, 22, 33, 33, "")#(20, 0, 33, 33, "Prog") self.contents.draw_text(-45, 0, 33, 33, "")#(55, 0, 33, 33, "ress") self.contents.draw_text(88, 0, 33, 33, " ")   #(88, 0, 33, 33, " ") self.contents.draw_text(-10, 0, 33, 33, "") #(110, 0, 33, 33, "% ") draw_actor_barz(0,20,35, "horizontal", 81, 11,$game_variables[1],100) #draw_actor_barz(0,20,35, "horizontal", 255, 28,$game_variables[1],100) @sprite = Sprite.new @sprite.bitmap = RPG::Cache.panorama("", 0)     # Definir Windowskin     self.windowskin = RPG::Cache.windowskin("")     # Definir Windowskin end #--------------------------------------------------------------------------------- end class Window_jauge2 < Window_Base def draw_normal_barz(x, y, type, length, thick, e1, e2, c1 = Color.new(255,0,0,255), c2 = Color.new(0,0,0,255))#couelru 2 hori if type == "horizontal" width = length height = thick self.contents.fill_rect(x-1, y - 1, width+2, height + 3, Color.new(255, 255, 255, 255)) self.contents.fill_rect(x, y, width, height + 1, Color.new(0, 0, 0, 255))# w = width * e1 / e2 for i in 0..height r = c1.red + (c2.red - c1.red) * (height -i)/height + 0 * i/height g = c1.green + (c2.green - c1.green) * (height -i)/height + 0 * i/height b = c1.blue + (c2.blue - c1.blue) * (height -i)/height + 0 * i/height a = c1.alpha + (c2.alpha - c1.alpha)* (height -i)/height + 255 * i/height self.contents.fill_rect(x, y+i, w, 1, Color.new(r, g, b, a)) end elsif type == "vertical" width = thick height = length self.contents.fill_rect(x-1, y - 1, width+3, height + 2, Color.new(255, 255, 255, 255)) self.contents.fill_rect(x, y, width+1, height , Color.new(0, 0, 0, 255)) h = height * e1 / e2 for i in 0..width r = c1.red + (c2.red - c1.red) * (width -i)/width + 0 * i/width g = c1.green + (c2.green - c1.green) * (width -i)/width + 0 * i/width b = c1.blue + (c2.blue - c1.blue) * (width -i)/width + 0 * i/width a = c1.alpha + (c2.alpha - c1.alpha)* (width -i)/width + 255 * i/width self.contents.fill_rect(x+i, y, 1, h, Color.new(r, g, b, a)) end end end #pour changer la couleur d'interieur  C2 = ligne du haut def draw_actor_barz(actor,x, y, type, length, thick, e1, e2, c1 = Color.new(255,255,255,255), c2 = Color.new(223, 115, 255,255))#couelru 2 verti if type == "horizontal" width = length height = thick self.contents.fill_rect(x-1, y - 1, width+2, height + 3, Color.new(182, 102, 210, 255)) #contour  ! self.contents.fill_rect(x, y, width, height + 1, Color.new(100, 100, 120, 255))#couleur du fond w = width * e1 / e2 for i in 0..height r = c1.red + (c2.red - c1.red) * (height -i)/height + 0 * i/height g = c1.green + (c2.green - c1.green) * (height -i)/height + 0 * i/height b = c1.blue + (c2.blue - c1.blue) * (height -i)/height + 100 * i/height a = c1.alpha + (c2.alpha - c1.alpha)* (height -i)/height + 255 * i/height self.contents.fill_rect(x, y+i, w, 1, Color.new(r, g, b, a)) end elsif type == "vertical" width = thick height = length self.contents.fill_rect(x-1, y - 1, width+3, height + 2, Color.new(255, 255, 255, 255)) self.contents.fill_rect(x, y, width+1, height , Color.new(0, 0, 0, 255))# h = height * e1 / e2 for i in 0..width r = c1.red + (c2.red - c1.red) * (width -i)/width + 0 * i/width g = c1.green + (c2.green - c1.green) * (width -i)/width + 0 * i/width b = c1.blue + (c2.blue - c1.blue) * (width -i)/width + 0 * i/width a = c1.alpha + (c2.alpha - c1.alpha)* (width -i)/width + 255 * i/width self.contents.fill_rect(x+i, y, 1, h, Color.new(r, g, b, a)) end end end end class Scene_Progress2 < Scene_Map #--------------------------------------------------------------------------------- def initialize end #--------------------------------------------------------------------------------- def main @window2 = Window_Progress2.new @window2.x =160#160 @window2.y =200#200 @window2.height =100 #100 @window2.width = 341#341 #@window1.z = 200 opacity = 0 @window2.update ###add Graphics.transition loop do Graphics.update Input.update           if Input.trigger?(Input::B) # キャンセル SE を演奏 $game_system.se_play($data_system.cancel_se) # マップ画面に切り替え @sprite = Sprite.new @sprite.bitmap = RPG::Cache.panorama("", 0) $scene = Scene_Menu.new end #update if $scene != self break end end Graphics.freeze @window2.dispose end #--------------------------------------------------------------------------------- #--------------------------------------------------------------------------------- def update end #--------------------------------------------------------------------------------- end class Window_Progress2 < Window_jauge2 #--------------------------------------------------------------------------------- def initialize super(-1, 411, 500,100)#(0, 0, 341,100) self.contents = Bitmap.new(width - 50, height - 32) self.contents.font.name = "Tahoma" self.contents.font.size = 24 self.contents.font.color = text_color(0) self.contents.draw_text(-80, 22, 33, 33, "")#(20, 0, 33, 33, "Prog") self.contents.draw_text(-45, 0, 33, 33, "")#(55, 0, 33, 33, "ress") self.contents.draw_text(88, 0, 33, 33, " ")   #(88, 0, 33, 33, " ") self.contents.draw_text(-10, 0, 33, 33, "") #(110, 0, 33, 33, "% ") draw_actor_barz(0,20,35, "horizontal", 81, 11,$game_variables[2],100) #draw_actor_barz(0,20,35, "horizontal", 255 longueur bar, 28largeur,$game_variables[1],100) @sprite = Sprite.new @sprite.bitmap = RPG::Cache.panorama("", 0)     # Definir Windowskin     self.windowskin = RPG::Cache.windowskin("")     # Definir Windowskin end #--------------------------------------------------------------------------------- end ####################### #alias #def main #@window2 = Window_Progress2.new #@window2 .update #@window2 .dispose #end class Window_jauge3 < Window_Base def draw_normal_barz(x, y, type, length, thick, e1, e2, c1 = Color.new(255,0,0,255), c2 = Color.new(0,0,0,255))#couelru 2 hori if type == "horizontal" width = length height = thick self.contents.fill_rect(x-1, y - 1, width+2, height + 3, Color.new(255, 255, 255, 255)) self.contents.fill_rect(x, y, width, height + 1, Color.new(0, 0, 0, 255))# w = width * e1 / e2 for i in 0..height r = c1.red + (c2.red - c1.red) * (height -i)/height + 0 * i/height g = c1.green + (c2.green - c1.green) * (height -i)/height + 0 * i/height b = c1.blue + (c2.blue - c1.blue) * (height -i)/height + 0 * i/height a = c1.alpha + (c2.alpha - c1.alpha)* (height -i)/height + 255 * i/height self.contents.fill_rect(x, y+i, w, 1, Color.new(r, g, b, a)) end elsif type == "vertical" width = thick height = length self.contents.fill_rect(x-1, y - 1, width+3, height + 2, Color.new(255, 255, 255, 255)) self.contents.fill_rect(x, y, width+1, height , Color.new(0, 0, 0, 255)) h = height * e1 / e2 for i in 0..width r = c1.red + (c2.red - c1.red) * (width -i)/width + 0 * i/width g = c1.green + (c2.green - c1.green) * (width -i)/width + 0 * i/width b = c1.blue + (c2.blue - c1.blue) * (width -i)/width + 0 * i/width a = c1.alpha + (c2.alpha - c1.alpha)* (width -i)/width + 255 * i/width self.contents.fill_rect(x+i, y, 1, h, Color.new(r, g, b, a)) end end end #pour changer la couleur d'interieur def draw_actor_barz(actor,x, y, type, length, thick, e1, e2, c1 = Color.new(0,255,255,255), c2 = Color.new(0,0,255,255))#couelru 2 verti if type == "horizontal" width = length height = thick self.contents.fill_rect(x-1, y - 1, width+2, height + 3, Color.new(15, 157, 232, 255)) #contour  ! self.contents.fill_rect(x, y, width, height + 1, Color.new(100, 120, 155, 255))#couleur du fond w = width * e1 / e2 for i in 0..height r = c1.red + (c2.red - c1.red) * (height -i)/height + 0 * i/height g = c1.green + (c2.green - c1.green) * (height -i)/height + 0 * i/height b = c1.blue + (c2.blue - c1.blue) * (height -i)/height + 255 * i/height a = c1.alpha + (c2.alpha - c1.alpha)* (height -i)/height + 255 * i/height self.contents.fill_rect(x, y+i, w, 1, Color.new(r, g, b, a)) end elsif type == "vertical" width = thick height = length self.contents.fill_rect(x-1, y - 1, width+3, height + 2, Color.new(255, 255, 255, 255)) self.contents.fill_rect(x, y, width+1, height , Color.new(0, 0, 0, 255))# h = height * e1 / e2 for i in 0..width r = c1.red + (c2.red - c1.red) * (width -i)/width + 0 * i/width g = c1.green + (c2.green - c1.green) * (width -i)/width + 0 * i/width b = c1.blue + (c2.blue - c1.blue) * (width -i)/width + 0 * i/width a = c1.alpha + (c2.alpha - c1.alpha)* (width -i)/width + 255 * i/width self.contents.fill_rect(x+i, y, 1, h, Color.new(r, g, b, a)) end end end end class Scene_Progress3 < Scene_Map #--------------------------------------------------------------------------------- def initialize end #--------------------------------------------------------------------------------- def main @window3 = Window_Progress3.new @window3.x =160#160 @window3.y =200#200 @window3.height =100 #100 @window3.width = 341#341 #@window1.z = 200 opacity = 0 @window3.update ###add Graphics.transition loop do Graphics.update Input.update           if Input.trigger?(Input::B) # キャンセル SE を演奏 $game_system.se_play($data_system.cancel_se) # マップ画面に切り替え @sprite = Sprite.new @sprite.bitmap = RPG::Cache.panorama("", 0) $scene = Scene_Menu.new end #update if $scene != self break end end Graphics.freeze @window3.dispose end #--------------------------------------------------------------------------------- #--------------------------------------------------------------------------------- def update end #--------------------------------------------------------------------------------- end class Window_Progress3 < Window_jauge3 #--------------------------------------------------------------------------------- def initialize super(253, 411, 500,100)#(0, 0, 341,100) self.contents = Bitmap.new(width - 50, height - 32) self.contents.font.name = "Tahoma" self.contents.font.size = 24 self.contents.font.color = text_color(0) self.contents.draw_text(-80, 22, 33, 33, "")#(20, 0, 33, 33, "Prog") self.contents.draw_text(-45, 0, 33, 33, "")#(55, 0, 33, 33, "ress") self.contents.draw_text(88, 0, 33, 33, " ")   #(88, 0, 33, 33, " ") self.contents.draw_text(-10, 0, 33, 33, "") #(110, 0, 33, 33, "% ") draw_actor_barz(0,20,35, "horizontal", 81, 11,$game_variables[3],100) #draw_actor_barz(0,20,35, "horizontal", 121 longueur bar, 28largeur,$game_variables[1],100) @sprite = Sprite.new @sprite.bitmap = RPG::Cache.panorama("", 0)     # Definir Windowskin     self.windowskin = RPG::Cache.windowskin("")     # Definir Windowskin end #--------------------------------------------------------------------------------- end ####################### #alias #def main #@window2 = Window_Progress2.new #@window2 .update #@window2 .dispose #end class Window_jauge4 < Window_Base def draw_normal_barz(x, y, type, length, thick, e1, e2, c1 = Color.new(255,0,0,255), c2 = Color.new(0,0,0,255))#couelru 2 hori if type == "horizontal" width = length height = thick self.contents.fill_rect(x-1, y - 1, width+2, height + 3, Color.new(255, 255, 255, 255)) self.contents.fill_rect(x, y, width, height + 1, Color.new(0, 0, 0, 255))# w = width * e1 / e2 for i in 0..height r = c1.red + (c2.red - c1.red) * (height -i)/height + 0 * i/height g = c1.green + (c2.green - c1.green) * (height -i)/height + 0 * i/height b = c1.blue + (c2.blue - c1.blue) * (height -i)/height + 0 * i/height a = c1.alpha + (c2.alpha - c1.alpha)* (height -i)/height + 255 * i/height self.contents.fill_rect(x, y+i, w, 1, Color.new(r, g, b, a)) end elsif type == "vertical" width = thick height = length self.contents.fill_rect(x-1, y - 1, width+3, height + 2, Color.new(255, 255, 255,255)) self.contents.fill_rect(x, y, width+1, height , Color.new(0, 0, 0,255)) h = height * e1 / e2 for i in 0..width r = c1.red + (c2.red - c1.red) * (width -i)/width + 0 * i/width g = c1.green + (c2.green - c1.green) * (width -i)/width + 0 * i/width b = c1.blue + (c2.blue - c1.blue) * (width -i)/width + 0 * i/width a = c1.alpha + (c2.alpha - c1.alpha)* (width -i)/width + 255 * i/width self.contents.fill_rect(x+i, y, 1, h, Color.new(r, g, b, a)) end end end #pour changer la couleur d'interieur def draw_actor_barz(actor,x, y, type, length, thick, e1, e2, c1 = Color.new(237, 127, 16,255), c2 = Color.new(255, 200, 100,255))#couelru 2 verti retirer noir if type == "horizontal" width = length height = thick self.contents.fill_rect(x-1, y - 1, width+2, height + 3, Color.new(237, 127, 16, 255)) #contour  ! self.contents.fill_rect(x, y, width, height + 1, Color.new(137, 127, 106, 255))#couleur du fond w = width * e1 / e2 for i in 0..height r = c1.red + (c2.red - c1.red) * (height -i)/height + 0 * i/height g = c1.green + (c2.green - c1.green) * (height -i)/height + 0 * i/height b = c1.blue + (c2.blue - c1.blue) * (height -i)/height + 0 * i/height a = c1.alpha + (c2.alpha - c1.alpha)* (height -i)/height + 255 * i/height self.contents.fill_rect(x, y+i, w, 1, Color.new(r, g, b, a)) end elsif type == "vertical" width = thick height = length self.contents.fill_rect(x-1, y - 1, width+3, height + 2, Color.new(255, 255, 255, 255)) self.contents.fill_rect(x, y, width+1, height , Color.new(0, 0, 0, 255))# h = height * e1 / e2 for i in 0..width r = c1.red + (c2.red - c1.red) * (width -i)/width + 0 * i/width g = c1.green + (c2.green - c1.green) * (width -i)/width + 0 * i/width b = c1.blue + (c2.blue - c1.blue) * (width -i)/width + 0 * i/width a = c1.alpha + (c2.alpha - c1.alpha)* (width -i)/width + 255 * i/width self.contents.fill_rect(x+i, y, 1, h, Color.new(r, g, b, a)) end end end end class Scene_Progress4 < Scene_Map #--------------------------------------------------------------------------------- def initialize end #--------------------------------------------------------------------------------- def main @window4 = Window_Progress4.new @window4.x =160#160 @window4.y =124#200 @window4.height =100 #100 @window4.width = 124#341 #@window1.z = 200 opacity = 0 @window4.update ###add Graphics.transition loop do Graphics.update Input.update           if Input.trigger?(Input::B) # キャンセル SE を演奏 $game_system.se_play($data_system.cancel_se) # マップ画面に切り替え @sprite = Sprite.new @sprite.bitmap = RPG::Cache.panorama("", 0) $scene = Scene_Menu.new end #update if $scene != self break end end Graphics.freeze @window4.dispose end #--------------------------------------------------------------------------------- #--------------------------------------------------------------------------------- def update end #--------------------------------------------------------------------------------- end class Window_Progress4 < Window_jauge4 #--------------------------------------------------------------------------------- def initialize super(126, 411, 500,100)#(0, 0, 341,100) H V self.contents = Bitmap.new(width - 50, height - 32) self.contents.font.name = "Tahoma" self.contents.font.size = 24 self.contents.font.color = text_color(0) self.contents.draw_text(-80, 22, 33, 33, "")#(20, 0, 33, 33, "Prog") self.contents.draw_text(-45, 0, 33, 33, "")#(55, 0, 33, 33, "ress") self.contents.draw_text(88, 0, 33, 33, " ")   #(88, 0, 33, 33, " ") self.contents.draw_text(-10, 0, 33, 33, "") #(110, 0, 33, 33, "% ") draw_actor_barz(0,20,35, "horizontal", 81, 11,$game_variables[4],100) #draw_actor_barz(0,20,35, "horizontal", 255 longueur bar, 28largeur,$game_variables[1],100) @sprite = Sprite.new @sprite.bitmap = RPG::Cache.panorama("", 0)     # Definir Windowskin     self.windowskin = RPG::Cache.windowskin("")     # Definir Windowskin end #--------------------------------------------------------------------------------- end [/code] [/spoiler] Le script prend en compte la variable 1,2,3 et 4.La variable est sur 100 au dela vous sortiraient du décor. variable 1 WC variable 2 sommeil variable 3 jauge eau variable 4 jauge faim Ensuite pour modifié les jauges faites,soit en event modifier variable ou en script avec ce code: Exemple: [code]$game_variables[2] += 13[/code] pour actualiser les jauge sur la map faire insérer script [code]Window_Progress.new Window_Progress2.new Window_Progress3.new Window_Progress4.new @img_fond = Sprite.new @img_fond.bitmap = RPG::Cache.picture("HUD6") [/code] En changeant l'image "HUD6" vous pouvez du coup changer l'interface graphique de la HUD si besoin. Et pour finir l'image à placer dans pictures,nommer la HUD6 [spoiler="Image HUD6"][img]http://ahp.li/ddddd639d3f5b563996f.png[/img][/spoiler] Suffit juste de changer les icone de l'image pour faire des jauges d'autres choses... Voila,j'espère ça vous plaira :)


[url=http://kasbakprod.wifeo.com/][img]http://ahp.li/ea2b3312fe93a23b94a1.png[/img][/url]

Ssozi

Expert
Ssozi
  • Messages : 1166

CE HUD script (RMXP)


jeu. 29 janv. 2015 - 09h34

Si j'ai bien compris, c'est un script complet? Tu as posté dans la section entraide, donc on aurait pu croire que tu avais un problème dessus mais apparemment, non. :p Faudrait que quelqu'un te le déplace au bon endroit ou que tu l'ajoutes toi même dans la bibliothèque du site! Ça se passe [url=http://www.eclipso.fr/bibliotheque.php?page=nouveau]ici[/url] pour le faire! :D Merci du partage en tout cas <3