Начинающий
Начинающий
- Статус
- Оффлайн
- Регистрация
- 16 Дек 2023
- Сообщения
- 633
- Реакции
- 9
Не знаю зачем и кому это,но как по мне прикольный тхуд и может кому то пригодится (без багов он)
client(posX, posY, width, height, 3, ColorUtils.setAlpha(getBackgroundColor(), alpha)); - заменяете на свой роунд для бенграунда тх
ColorUtils.setAlpha(getBackgroundColor(), alpha))... - можете убрать setAlpha... и просто везде ColorUtils.rgba(....) тк у вас нет alpha-прозрачности (или есть)
ну и всэ впринципе
Upd:забыл метод drawHealth:
Код:
if (Hud.singleton.get().isEnabled() && Hud.singleton.get().txType.get("Nursultan")) {
width = Math.max(185 / 1.5f, nameWidth + headSize + spacing * 2);
height = 59 / 1.5f;
headSize = 30;
client(posX, posY, width, height, 3, ColorUtils.setAlpha(getBackgroundColor(), alpha));
float headY = posY + (height / 2) - (headSize / 2);
drawTargetHead(entity, posX + spacing, headY, headSize, headSize);
DisplayUtils.drawRadiusHead(posX + spacing, headY, headSize, headSize, 4, ColorUtils.setAlpha(getBackgroundColor(), alpha));
float lineX = posX + headSize + spacing * 2;
ScissorUtil.enable();
ScissorUtil.setFromComponentCoordinates(posX, posY, width, height);
Fonts.client[16].drawString(eventDisplay.getMatrixStack(), getDisplayName(entity), lineX, posY + spacing + 2, ColorUtils.setAlpha(getTextColor(), alpha));
ScissorUtil.unset();
ScissorUtil.disable();
renderArmorItems(entity, lineX - 1, posY + spacing + 10, 0.51f);
float barWidth = width - (headSize + spacing * 3f);
float barY = posY + height - spacing * 2 - 3.5f;
DisplayUtils.drawRoundedRect(posX + spacing + 34, barY, barWidth, 4, 1.5f, ColorUtils.rgba(18,18,18,200));
DisplayUtils.drawTwoGradient(posX + spacing + 34, barY, barWidth * healthBarAnimation, 4, 1.5f, getFirst(), getSecond());
drawHealth(eventDisplay, posX, posY + 0.5f, headSize, spacing, width, height, healthBarAnimation, hp);
GlStateManager.popMatrix();
}
client(posX, posY, width, height, 3, ColorUtils.setAlpha(getBackgroundColor(), alpha)); - заменяете на свой роунд для бенграунда тх
ColorUtils.setAlpha(getBackgroundColor(), alpha))... - можете убрать setAlpha... и просто везде ColorUtils.rgba(....) тк у вас нет alpha-прозрачности (или есть)
ну и всэ впринципе
Upd:забыл метод drawHealth:
Код:
private void drawHealth(Render2DEvent render2DEvent, float posX, float finalPosY, float headSize, float spacing, float boxWidth, float boxHeight, float healthProgress, float currentHealth) {
float barWidth = (boxWidth - 46f) * healthProgress;
String healthText = String.format("%.1f", healthTextAnimation);
int textWidth = (int) Fonts.client[14].getWidth(healthText);
float barStartX = posX + headSize + spacing * 2;
float textX = barStartX + barWidth - textWidth / 2.0f;
float textY = finalPosY + boxHeight - spacing - 2;
float maxTextX = barStartX + barWidth - textWidth;
float minTextX = barStartX;
if (barWidth <= textWidth) {
textX = barStartX;
} else {
if (textX < minTextX) {
textX = minTextX;
} else if (textX > maxTextX) {
textX = maxTextX;
}
}
Fonts.client[14].drawString(render2DEvent.getMatrixStack(), healthText, textX, textY, ColorUtils.rgb(255, 255, 255));
}
Последнее редактирование: