Help aligning armor to box

Posts 1–2 of 2 · Page 1 of 1
Help aligning armor to box
Code:
void Visuals::Player::RenderArmour()
{
	auto  armour = esp_ctx.pl->m_ArmorValue();
	float box_h = (float)fabs(esp_ctx.bbox.left - esp_ctx.bbox.right);
	//float off = (box_h / 6.f) + 5;
	float off = 4;

	auto height = (((box_h * armour) / 100));

	int x = esp_ctx.bbox.right + off;
	int y = esp_ctx.bbox.top;
	int w = 4;
	int h = box_h;

	g_VGuiSurface->DrawSetColor(Color::Transparent);
	g_VGuiSurface->DrawFilledRect(x, y, x + w, y + h);

	g_VGuiSurface->DrawSetColor(Color(0, 50, 255, 255));
	g_VGuiSurface->DrawFilledRect(x + 1, y + 1, x + w - 1, y + height - 2);
}
Right now it is aligned with the right side of the box, I have tried changing int w = box_w; then int h = 4 but it like unlocks itself from the box and will move with the screen. Im not sure what I can do to make it align with the bottom of the box. I feel like this is really easy to do but im just starting out and once i got to this point i gave up. Also this isnt my code I took it from a source

float box_h = (float)fabs(esp_ctx.bbox.bottom - esp_ctx.bbox.top);
Posts 1–2 of 2 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us