Advertisement
Guest User

Untitled

a guest
Oct 17th, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. int HPEnemy = 100;
  2. HPEnemy = pEntity->GetHealth();
  3. char nameBuffer[512];
  4. sprintf(nameBuffer, "%d", HPEnemy);
  5.  
  6.  
  7. float h = (size.h);
  8. float offset = (h / 4.f) + 5;
  9. float w = h / 64.f;
  10. float health = pEntity->GetHealth();
  11. UINT hp = h - (UINT)((h * health) / 100);
  12.  
  13. int Red = 255 - (health*2.55);
  14. int Green = health*2.55;
  15.  
  16. Render::DrawOutlinedRect((size.x - 6) - 1, size.y - 1, 3, h + 2, Color(0, 0, 0, 180));
  17.  
  18. Render::DrawLine((size.x - 6), size.y + hp, (size.x - 6), size.y + h, Color(Red, Green, 0, 180));
  19.  
  20. if (health < 100) {
  21.  
  22. Render::Text(size.x - 9, size.y + hp, Color(255, 255, 255, 255), Render::Fonts::ESP, nameBuffer);
  23. }
  24. }
  25. }
  26.  
  27. in RenderManager.cpp
  28.  
  29.  
  30. void Render::DrawOutlinedRect(int x, int y, int w, int h, Color col)
  31. {
  32. Interfaces::Surface->DrawSetColor(col);
  33. Interfaces::Surface->DrawOutlinedRect(x, y, x + w, y + h);
  34. }
  35.  
  36. void Render::DrawLine(int x0, int y0, int x1, int y1, Color col)
  37. {
  38. Interfaces::Surface->DrawSetColor(col);
  39. Interfaces::Surface->DrawLine(x0, y0, x1, y1);
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement