RPG Fusion
Vous souhaitez réagir à ce message ? Créez un compte en quelques clics ou connectez-vous pour continuer.



 
AccueilPortailRechercherDernières imagesS'enregistrerConnexion
Le Deal du moment :
Cartes Pokémon 151 : où trouver le ...
Voir le deal

 

 Afficher les Mp, Hp sur la Map

Aller en bas 
2 participants
AuteurMessage
Sansonic
Auguste Polichinelle
Auguste Polichinelle
Sansonic


Masculin
Nombre de messages : 1116
Age : 31
Projet(s) en cours : ...
Niveau Rpg Maker : jugez !...
Date d'inscription : 28/07/2007

Afficher les Mp, Hp sur la Map Empty
MessageSujet: Afficher les Mp, Hp sur la Map   Afficher les Mp, Hp sur la Map EmptyMer 24 Oct 2007, 19:15

Auteur: N.A

Fonction: Affiche les Mp, Hp sur la Map

Installation: Placez cette image dans le dossier Picture de votre projetAfficher les Mp, Hp sur la Map Chudy5qf4elhy1
Puis faite un event et mettez la commande "afficher une image" grâce au commande
d'évènement et sélectionner l'image prit ci-dessus. (selectionner
haut-gauche quand vous afficher l'image)

Inutile de faire des changements dans les coordonnées ...

Picture:
Afficher les Mp, Hp sur la Map Screnn1kw8
Afficher les Mp, Hp sur la Map Screnn2fh5

Le script (F11 puis coller au dessus de Main, nommé le Scene_Map ):

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 = "Tahoma" 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("Arial")
self.opacity = 0
end
#-----------------------------------------------------------------
def update
self.contents.clear
actor = $game_party.actors[0„
draw_actor_hp(actor,30,0)
draw_actor_sp(actor,40,0)
end
#-----------------------------------------------------------------
def draw_actor_hp(actor,x,y)
width = 128
y  = 4
white = Color.new(255,255,255,255)
black = Color.new(98,51,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(224,green,0,255)
w_color = Color.new(255,green 32,96,255)
if green > 64 then green -= 32
elsif green > 128 then green -= 64 end
b_color = Color.new(172,green,0,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(255,255,255,255)
black = Color.new(98,51,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(224,blue,0,255)
w_color = Color.new(255,blue 32,96,255)
if blue > 64 then blue -= 32
elsif blue > 128 then blue -= 64 end
b_color = Color.new(172,blue,0,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
#-----------------------------------------------------------------
end
#-----------------------------------------------------------------
Revenir en haut Aller en bas
http://callgame.bbactif.com/portal.htm
Don Estebahn
Maître du Savoir
Maître du Savoir
Don Estebahn


Masculin
Nombre de messages : 2145
Age : 33
Jeux Préférés : Soul Reaver, Morrowind, Way of the Samurai
Date d'inscription : 18/02/2007

Afficher les Mp, Hp sur la Map Empty
MessageSujet: Re: Afficher les Mp, Hp sur la Map   Afficher les Mp, Hp sur la Map EmptyMer 24 Oct 2007, 19:32

Hé, vraiment pas mal... O.o Je trouve l'effet vraiment sympa, beaucoup plus esthétique que l'autre script d'affichage HP/MP sur la map.
Le script a aussi le gros avantage d'être facilement customisable pour qui n'y connait rien au RGSS, ce qui n'est pas négligeable... bref, ça a l'air d'être tout bon.

Autrement, la présentation est complète, rien à redire là dessus.
Je t'ajoute 1 PA. Merci à toi! [Don hypocrite]
Revenir en haut Aller en bas
 
Afficher les Mp, Hp sur la Map
Revenir en haut 
Page 1 sur 1
 Sujets similaires
-
» Afficher l'argent sur la map
» Afficher les PV/PM sur les maps v.2
» Afficher une barre de vie interactive.
» Afficher la progression du jeu en % dans le menu

Permission de ce forum:Vous ne pouvez pas répondre aux sujets dans ce forum
RPG Fusion :: BANQUE DU CODE :: Antre des Scripts :: Menu-
Sauter vers:  
Ne ratez plus aucun deal !
Abonnez-vous pour recevoir par notification une sélection des meilleurs deals chaque jour.
IgnorerAutoriser