Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int HPEnemy = 100;
- HPEnemy = pEntity->GetHealth();
- char nameBuffer[512];
- sprintf(nameBuffer, "%d", HPEnemy);
- float h = (size.h);
- float offset = (h / 4.f) + 5;
- float w = h / 64.f;
- float health = pEntity->GetHealth();
- UINT hp = h - (UINT)((h * health) / 100);
- int Red = 255 - (health*2.55);
- int Green = health*2.55;
- Render::DrawOutlinedRect((size.x - 6) - 1, size.y - 1, 3, h + 2, Color(0, 0, 0, 180));
- Render::DrawLine((size.x - 6), size.y + hp, (size.x - 6), size.y + h, Color(Red, Green, 0, 180));
- if (health < 100) {
- Render::Text(size.x - 9, size.y + hp, Color(255, 255, 255, 255), Render::Fonts::ESP, nameBuffer);
- }
- }
- }
- in RenderManager.cpp
- void Render::DrawOutlinedRect(int x, int y, int w, int h, Color col)
- {
- Interfaces::Surface->DrawSetColor(col);
- Interfaces::Surface->DrawOutlinedRect(x, y, x + w, y + h);
- }
- void Render::DrawLine(int x0, int y0, int x1, int y1, Color col)
- {
- Interfaces::Surface->DrawSetColor(col);
- Interfaces::Surface->DrawLine(x0, y0, x1, y1);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement