Jump to content
Rpg²S Forum
  • 0

Problema script Draw Slant Bar


War10Hack
 Share

Question

Salve popolo, oggi ho preso uno script dal forum, realizzato da Sephiroth, il quale permette di avere delle comode barre Hp/Sp ,sul party e sui mostri, invece dei soliti numeretti che mette di default rmxp. Bene bene, lo script funziona meravigliosamente ma mi dà un piccolo errore con quello che dovrei fare io. In pratica lo script mostra sempre le barre anche se il mostro è invisibile. A questo punto mi rivolgo a voi, non si potrebbe fare in modo che la barra hp mostro compari solo quando il mostro non è invisibile?

Eccovi uno screen per farvi meglio capire:

http://xxximagehosting.com/images/SUDUdzYsYT/secondscreen___i72Oukm26q.png

 

Questo è lo script:

 

class Window_EnemyHP < Window_Base

def initialize
super(0, 0, 640, 480)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = 0
refresh
end

def refresh
self.contents.clear
$fontsize == 22
$fontface == "Monotype Corsiva"
for i in 0...$game_troop.enemies.size
@enemy = $game_troop.enemies
@percent = (@enemy.hp * 100) / @enemy.maxhp
unless @enemy.hp == 0
draw_slant_bar(@enemy.screen_x - 55, @enemy.screen_y - 10, @enemy.hp, @enemy.maxhp, width = 75, height = 6, bar_color = Color.new(150, 0, 0, 255), end_color = Color.new(255, 255, 60, 255))
self.contents.draw_text(@enemy.screen_x - 39, @enemy.screen_y - 22, 100, 32, "#{@percent}" + "%")
end
end
end
end

 

 

Al massimo se non si potesse fare ciò da me richiesto, potete eliminare la parte che fa comparire la barra sotto il mostro? Eh bho, ho terminato quello che avevo da dire, in cambio dell'aiuto vi posso creditare nel gioco, enjoy ^ ^

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...