Untitled
unknown
c_cpp
a year ago
782 B
6
Indexable
void HealthBar(float x, float y, float w, float h, float percentage, ImColor colFg) {
ImDrawList* draw = ImGui::GetForegroundDrawList();
ImU32 colBg = IM_COL32(255, 0, 0, 255); // Red background
draw->AddRectFilled(ImVec2(x, y), ImVec2(x + w, y + h), colBg);
float filled_h = h * (percentage / 100.0f);
draw->AddRectFilled(ImVec2(x, y + h - filled_h), ImVec2(x + w, y + h), colFg);
}
if (vars::healthbars) {
float Percentage = (nameEntry.health / 127.0f) * 100.0f;
float CornerHeight = abs(head.y - screen.y);
float CornerWidth = CornerHeight * 0.65f;
float width = max(min(CornerWidth / 10.0f, 3.0f), 2.0f);
float height = screen.y - head.y;
HealthBar(head.x - (CornerWidth / 2) - 10, head.y, width, height, Percentage, ESPColor);
}Editor is loading...
Leave a Comment