20-02-2008, 03:07 PM
Bingo... you had me baffled there for a minute, but check it out....
the call to blit the .DrawBox to the BackBuffer uses y + 32 to calculate the position of the HP bar.
I think the -4 bit is to make up for the slight offset of the sprites on the map, ever noticed that they don't quite fit on the map squares properly?
Code:
Call DD_BackBuffer.SetFillColor(RGB(255, 0, 0))
Call DD_BackBuffer.DrawBox(x, y + 32, x + 32, y + 36)
Call DD_BackBuffer.SetFillColor(RGB(0, 255, 0))
Call DD_BackBuffer.DrawBox(x, y + 32, x + ((MapNpc(Index).HP / 100) / (MapNpc(Index).MaxHP / 100) * 32), y + 36)
I think the -4 bit is to make up for the slight offset of the sprites on the map, ever noticed that they don't quite fit on the map squares properly?