Okay lets say I want a graphic to appear as a hud. An HP bar so to say. I know how to measure how much HP and MAXHP a character has. But I want more of the graphic to appear depending on how much Max hp I have. Lets say I have 3 hp, I want three hearts instead of one to appear across. How do I multiply method calls depending on max hp and current hp?
def drawmaphp(maxhp, hp, x, y)
back = RPG::Cache.picture("StrawberryEmpty")
cw = back.width
ch = back.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x, y, back, src_rect)
meter = RPG::Cache.picture("Strawberry")
cw = meter.width
ch = meter.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x, y, meter, src_rect)
end
Then the method call
actor = $game_party.actors[0]
drawmaphp(actor.maxhp, actor.hp, 0, 0)
def drawmaphp(maxhp, hp, x, y)
back = RPG::Cache.picture("StrawberryEmpty")
cw = back.width
ch = back.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x, y, back, src_rect)
meter = RPG::Cache.picture("Strawberry")
cw = meter.width
ch = meter.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x, y, meter, src_rect)
end
Then the method call
actor = $game_party.actors[0]
drawmaphp(actor.maxhp, actor.hp, 0, 0)