So I think this might be a case of "using code at the wrong place"
And if I am barking up the wrong tree feel free to let me know.
But I just recently started working with RSPS development and I wanted to add a HP bar at the top left when
fighting a monster, shouldn't be too hard I figured, it's just a matter of drawing a gray rectangle
with two smaller rectangles on top of it, one green and one red, with the green covering the red one
and when the HP goes down, do the calculations for the green bar to shrink, revealing the red one.
Here is the issue I am having..
I've started off by trying to draw on the Client, I'm a C# developer so Java isn't my primary language
so there are a few things I might misinterpret.
However.. I did some research and found out that making use of the paint method
is something you should do.
So in Client.java I did this.
Code:
public void paint(Graphics g){
g.setColor(Color.blue);
g.setFont(new Font("Arial",Font.BOLD,14));
g.drawString("Testing", 50, 40);
}
And it did draw!
However..
It only draws it on as the server is loading up, only for a couple of seconds then it's gone. It won't show up in game or anything similar to that.
How do I get it to draw when I attack something, like, it should be hidden until I get into combat, that's the part I am having an issue with I am pretty sure I could figure out the rest.
I've been dabbling around with this for quite a while so would be really nice if someone could throw some advice my way.
I am using a Vencilio Server, Cache & Client.