Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Thread of questions
#20
Bingo... you had me baffled there for a minute, but check it out....
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)
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?
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)