Мой TargetHud 1.16.5 esxpenxsive ready

  • Автор темы Автор темы .arab
  • Дата начала Дата начала
Забаненный
Забаненный
Статус
Оффлайн
Регистрация
15 Фев 2024
Сообщения
16
Реакции
0
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Привет форум, решил поиграться со своим худом и добавить минималистичный TargetHud. Здесь крайне простое получение здоровья для отрисовки цвета к каждой категории. И да я знаю, что тут используется Stencil для закругленный головы (это херня я понимаю)

Пожалуйста, авторизуйтесь для просмотра ссылки.

Пожалуйста, авторизуйтесь для просмотра ссылки.

Пожалуйста, авторизуйтесь для просмотра ссылки.


arab:
Expand Collapse Copy
private void onRenderTargetHud5(final MatrixStack stack) {
        this.target = getTarget(this.target);
        this.tagetHudAnimation5.setDuration(300); // чел добавь сюда свою анимацию
        this.scale = tagetHudAnimation3.getOutput();

        if (scale == 0.0F) {
            target = null;
        }

        if (target == null) {
            return;
        }

        final String targetName = this.target.getName().getString();

        String substring = targetName.substring(0, Math.min(targetName.length(), 10));
        final float nameWidth = Fonts.gilroyBold[18].getWidth(substring);
        final float xPosition = this.TargetHUD5.getX();
        final float yPosition = this.TargetHUD5.getY();
        final float maxWidth = Math.max(nameWidth + 45, 114);
        final float maxHeight = 30;

        this.health = AnimationMath.fast(health, target.getHealth() / target.getMaxHealth(), 5);
        this.health = MathHelper.clamp(this.health, 0, 1);
        this.healthplus = AnimationMath.fast(healthplus, target.getAbsorptionAmount() / target.getMaxHealth(), 5);
        this.healthplus = MathHelper.clamp(this.healthplus, 0, 1);

        GlStateManager.pushMatrix();
        AnimationMath.sizeAnimation(xPosition + (maxWidth / 2), yPosition + (maxHeight / 2), scale);

   
        float posX = xPosition;
        float posY = yPosition;
        float width = maxWidth;
        int firstColor = ColorUtil.getColorStyle(0);
        int secondColor = ColorUtil.getColorStyle(90);
        float height = maxHeight + 10;
        int roundDegree = 7;
        int alpha = 140;
        int shadowAlpha = alpha / 2;
        int shadowColor1 = (firstColor & 0xFFFFFF) | (shadowAlpha << 24);
        int shadowColor2 = (secondColor & 0xFFFFFF) | (shadowAlpha << 24);
        int gradientColor = (MenuColorUtil.Theme.bg20.getRGB() & 0xFFFFFF) | (alpha << 24);
        // фон с тенью и свечением
        RenderUtil.Render2D.drawGradientRound(posX, posY, width, height, roundDegree - 1, shadowColor1, gradientColor, gradientColor, shadowColor2);
        // обводка
        RenderUtil.Render2D.drawRoundOutline(posX, posY, width, height, roundDegree, 1, b_color, new Vector4i(Helper.STYLE_MANAGER.getCurrentStyle().getColor(150), Helper.STYLE_MANAGER.getCurrentStyle().getColor(100), Helper.STYLE_MANAGER.getCurrentStyle().getColor(50), Helper.STYLE_MANAGER.getCurrentStyle().getColor(1)));

        float healthBarX = xPosition + 42;
        float healthBarY = yPosition + 26;
        float healthBarWidth = 64 * health;
        float healthBarHeight = 7;

        // тут цвет полосы взависимости от здоровья
        int color;
        if (health >= 0.65f) { // Зеленый 65% и выше
            color = Color.GREEN.getRGB();
        } else if (health >= 0.35f) { // Оранжевый 35%  до 65%
            color = Color.ORANGE.getRGB();
        } else { // Красный для менее 35%
            color = Color.RED.getRGB();
        }
        // кто хочет поставит проценты так как ему надо



        RenderUtil.Render2D.drawRoundedRect(healthBarX, healthBarY, 64, healthBarHeight, 3f, rgba(21, 21, 21, 255));
        RenderUtil.Render2D.drawShadow(healthBarX, healthBarY, healthBarWidth, healthBarHeight, 10, color);
        RenderUtil.Render2D.drawGradientRound(healthBarX, healthBarY, healthBarWidth, healthBarHeight, 3, color, color, color, color);
        RenderUtil.Render2D.drawRoundOutline(posX, posY, width, height, roundDegree, 1, b_color, new Vector4i(Helper.STYLE_MANAGER.getCurrentStyle().getColor(150), Helper.STYLE_MANAGER.getCurrentStyle().getColor(100), Helper.STYLE_MANAGER.getCurrentStyle().getColor(50), Helper.STYLE_MANAGER.getCurrentStyle().getColor(1)));

        // крайне хреновое закругление головы
        StencilUtil.initStencilToWrite();
        RenderUtil.Render2D.drawRoundedRect(xPosition + 4, yPosition + 4, 32, 32, 6, Color.BLACK.getRGB());
        StencilUtil.readStencilBuffer(1);
        IMinecraft.mc.getTextureManager().bindTexture(((AbstractClientPlayerEntity) target).getLocationSkin());
        AbstractGui.drawScaledCustomSizeModalRect(xPosition + 4, yPosition + 4, 8F, 8F, 8F, 8F, 32, 32, 64F, 64F);
        StencilUtil.uninitStencilBuffer();
        Fonts.gilroyBold[18].drawString(stack, substring, xPosition + 42, yPosition + 7, -1);

        String healthValue = (int) MathUtil.round(this.health * 20 + target.getAbsorptionAmount(), 0.5f) + ".00 HP";
        Fonts.gilroyBold[12].drawCenteredString(stack, healthValue, xPosition + maxWidth - 58, yPosition + maxHeight / 1.5 - 2.2f, ColorUtil.rgba(255, 255, 255, 255));
        GlStateManager.popMatrix();
        this.TargetHUD5.setWidth(maxWidth);
        this.TargetHUD5.setHeight(maxHeight);

    }
 
Последнее редактирование:
норм
 
Достаточно прикольно, сам недавно сделал такой же хп)
Если еще наложить туда анимацию, будет ваще ахеренно
 
Привет форум, решил поиграться со своим худом и добавить минималистичный TargetHud. Здесь крайне простое получение здоровья для отрисовки цвета к каждой категории. И да я знаю, что тут используется Stencil для закругленный головы (это херня я понимаю)

Пожалуйста, авторизуйтесь для просмотра ссылки.

Пожалуйста, авторизуйтесь для просмотра ссылки.

Пожалуйста, авторизуйтесь для просмотра ссылки.


arab:
Expand Collapse Copy
private void onRenderTargetHud5(final MatrixStack stack) {
        this.target = getTarget(this.target);
        this.tagetHudAnimation5.setDuration(300); // чел добавь сюда свою анимацию
        this.scale = tagetHudAnimation3.getOutput();

        if (scale == 0.0F) {
            target = null;
        }

        if (target == null) {
            return;
        }

        final String targetName = this.target.getName().getString();

        String substring = targetName.substring(0, Math.min(targetName.length(), 10));
        final float nameWidth = Fonts.gilroyBold[18].getWidth(substring);
        final float xPosition = this.TargetHUD5.getX();
        final float yPosition = this.TargetHUD5.getY();
        final float maxWidth = Math.max(nameWidth + 45, 114);
        final float maxHeight = 30;

        this.health = AnimationMath.fast(health, target.getHealth() / target.getMaxHealth(), 5);
        this.health = MathHelper.clamp(this.health, 0, 1);
        this.healthplus = AnimationMath.fast(healthplus, target.getAbsorptionAmount() / target.getMaxHealth(), 5);
        this.healthplus = MathHelper.clamp(this.healthplus, 0, 1);

        GlStateManager.pushMatrix();
        AnimationMath.sizeAnimation(xPosition + (maxWidth / 2), yPosition + (maxHeight / 2), scale);

 
        float posX = xPosition;
        float posY = yPosition;
        float width = maxWidth;
        int firstColor = ColorUtil.getColorStyle(0);
        int secondColor = ColorUtil.getColorStyle(90);
        float height = maxHeight + 10;
        int roundDegree = 7;
        int alpha = 140;
        int shadowAlpha = alpha / 2;
        int shadowColor1 = (firstColor & 0xFFFFFF) | (shadowAlpha << 24);
        int shadowColor2 = (secondColor & 0xFFFFFF) | (shadowAlpha << 24);
        int gradientColor = (MenuColorUtil.Theme.bg20.getRGB() & 0xFFFFFF) | (alpha << 24);
        // фон с тенью и свечением
        RenderUtil.Render2D.drawGradientRound(posX, posY, width, height, roundDegree - 1, shadowColor1, gradientColor, gradientColor, shadowColor2);
        // обводка
        RenderUtil.Render2D.drawRoundOutline(posX, posY, width, height, roundDegree, 1, b_color, new Vector4i(Helper.STYLE_MANAGER.getCurrentStyle().getColor(150), Helper.STYLE_MANAGER.getCurrentStyle().getColor(100), Helper.STYLE_MANAGER.getCurrentStyle().getColor(50), Helper.STYLE_MANAGER.getCurrentStyle().getColor(1)));

        float healthBarX = xPosition + 42;
        float healthBarY = yPosition + 26;
        float healthBarWidth = 64 * health;
        float healthBarHeight = 7;

        // тут цвет полосы взависимости от здоровья
        int color;
        if (health >= 0.65f) { // Зеленый 65% и выше
            color = Color.GREEN.getRGB();
        } else if (health >= 0.35f) { // Оранжевый 35%  до 65%
            color = Color.ORANGE.getRGB();
        } else { // Красный для менее 35%
            color = Color.RED.getRGB();
        }
        // кто хочет поставит проценты так как ему надо



        RenderUtil.Render2D.drawRoundedRect(healthBarX, healthBarY, 64, healthBarHeight, 3f, rgba(21, 21, 21, 255));
        RenderUtil.Render2D.drawShadow(healthBarX, healthBarY, healthBarWidth, healthBarHeight, 10, color);
        RenderUtil.Render2D.drawGradientRound(healthBarX, healthBarY, healthBarWidth, healthBarHeight, 3, color, color, color, color);
        RenderUtil.Render2D.drawRoundOutline(posX, posY, width, height, roundDegree, 1, b_color, new Vector4i(Helper.STYLE_MANAGER.getCurrentStyle().getColor(150), Helper.STYLE_MANAGER.getCurrentStyle().getColor(100), Helper.STYLE_MANAGER.getCurrentStyle().getColor(50), Helper.STYLE_MANAGER.getCurrentStyle().getColor(1)));

        // крайне хреновое закругление головы
        StencilUtil.initStencilToWrite();
        RenderUtil.Render2D.drawRoundedRect(xPosition + 4, yPosition + 4, 32, 32, 6, Color.BLACK.getRGB());
        StencilUtil.readStencilBuffer(1);
        IMinecraft.mc.getTextureManager().bindTexture(((AbstractClientPlayerEntity) target).getLocationSkin());
        AbstractGui.drawScaledCustomSizeModalRect(xPosition + 4, yPosition + 4, 8F, 8F, 8F, 8F, 32, 32, 64F, 64F);
        StencilUtil.uninitStencilBuffer();
        Fonts.gilroyBold[18].drawString(stack, substring, xPosition + 42, yPosition + 7, -1);

        String healthValue = (int) MathUtil.round(this.health * 20 + target.getAbsorptionAmount(), 0.5f) + ".00 HP";
        Fonts.gilroyBold[12].drawCenteredString(stack, healthValue, xPosition + maxWidth - 58, yPosition + maxHeight / 1.5 - 2.2f, ColorUtil.rgba(255, 255, 255, 255));
        GlStateManager.popMatrix();
        this.TargetHUD5.setWidth(maxWidth);
        this.TargetHUD5.setHeight(maxHeight);

    }
прикольный таргет худ, очень сильно на вилда похож
 
наконец-то что-то годное
для пастеров пойдет а то эти ваши super duper jopa penis watermark 3.0000000 2040
кстате lays chipsi с крабом ready??
 
полоска на фоне здоровья ее бы потолще
 
Привет форум, решил поиграться со своим худом и добавить минималистичный TargetHud. Здесь крайне простое получение здоровья для отрисовки цвета к каждой категории. И да я знаю, что тут используется Stencil для закругленный головы (это херня я понимаю)

Пожалуйста, авторизуйтесь для просмотра ссылки.

Пожалуйста, авторизуйтесь для просмотра ссылки.

Пожалуйста, авторизуйтесь для просмотра ссылки.


arab:
Expand Collapse Copy
private void onRenderTargetHud5(final MatrixStack stack) {
        this.target = getTarget(this.target);
        this.tagetHudAnimation5.setDuration(300); // чел добавь сюда свою анимацию
        this.scale = tagetHudAnimation3.getOutput();

        if (scale == 0.0F) {
            target = null;
        }

        if (target == null) {
            return;
        }

        final String targetName = this.target.getName().getString();

        String substring = targetName.substring(0, Math.min(targetName.length(), 10));
        final float nameWidth = Fonts.gilroyBold[18].getWidth(substring);
        final float xPosition = this.TargetHUD5.getX();
        final float yPosition = this.TargetHUD5.getY();
        final float maxWidth = Math.max(nameWidth + 45, 114);
        final float maxHeight = 30;

        this.health = AnimationMath.fast(health, target.getHealth() / target.getMaxHealth(), 5);
        this.health = MathHelper.clamp(this.health, 0, 1);
        this.healthplus = AnimationMath.fast(healthplus, target.getAbsorptionAmount() / target.getMaxHealth(), 5);
        this.healthplus = MathHelper.clamp(this.healthplus, 0, 1);

        GlStateManager.pushMatrix();
        AnimationMath.sizeAnimation(xPosition + (maxWidth / 2), yPosition + (maxHeight / 2), scale);

  
        float posX = xPosition;
        float posY = yPosition;
        float width = maxWidth;
        int firstColor = ColorUtil.getColorStyle(0);
        int secondColor = ColorUtil.getColorStyle(90);
        float height = maxHeight + 10;
        int roundDegree = 7;
        int alpha = 140;
        int shadowAlpha = alpha / 2;
        int shadowColor1 = (firstColor & 0xFFFFFF) | (shadowAlpha << 24);
        int shadowColor2 = (secondColor & 0xFFFFFF) | (shadowAlpha << 24);
        int gradientColor = (MenuColorUtil.Theme.bg20.getRGB() & 0xFFFFFF) | (alpha << 24);
        // фон с тенью и свечением
        RenderUtil.Render2D.drawGradientRound(posX, posY, width, height, roundDegree - 1, shadowColor1, gradientColor, gradientColor, shadowColor2);
        // обводка
        RenderUtil.Render2D.drawRoundOutline(posX, posY, width, height, roundDegree, 1, b_color, new Vector4i(Helper.STYLE_MANAGER.getCurrentStyle().getColor(150), Helper.STYLE_MANAGER.getCurrentStyle().getColor(100), Helper.STYLE_MANAGER.getCurrentStyle().getColor(50), Helper.STYLE_MANAGER.getCurrentStyle().getColor(1)));

        float healthBarX = xPosition + 42;
        float healthBarY = yPosition + 26;
        float healthBarWidth = 64 * health;
        float healthBarHeight = 7;

        // тут цвет полосы взависимости от здоровья
        int color;
        if (health >= 0.65f) { // Зеленый 65% и выше
            color = Color.GREEN.getRGB();
        } else if (health >= 0.35f) { // Оранжевый 35%  до 65%
            color = Color.ORANGE.getRGB();
        } else { // Красный для менее 35%
            color = Color.RED.getRGB();
        }
        // кто хочет поставит проценты так как ему надо



        RenderUtil.Render2D.drawRoundedRect(healthBarX, healthBarY, 64, healthBarHeight, 3f, rgba(21, 21, 21, 255));
        RenderUtil.Render2D.drawShadow(healthBarX, healthBarY, healthBarWidth, healthBarHeight, 10, color);
        RenderUtil.Render2D.drawGradientRound(healthBarX, healthBarY, healthBarWidth, healthBarHeight, 3, color, color, color, color);
        RenderUtil.Render2D.drawRoundOutline(posX, posY, width, height, roundDegree, 1, b_color, new Vector4i(Helper.STYLE_MANAGER.getCurrentStyle().getColor(150), Helper.STYLE_MANAGER.getCurrentStyle().getColor(100), Helper.STYLE_MANAGER.getCurrentStyle().getColor(50), Helper.STYLE_MANAGER.getCurrentStyle().getColor(1)));

        // крайне хреновое закругление головы
        StencilUtil.initStencilToWrite();
        RenderUtil.Render2D.drawRoundedRect(xPosition + 4, yPosition + 4, 32, 32, 6, Color.BLACK.getRGB());
        StencilUtil.readStencilBuffer(1);
        IMinecraft.mc.getTextureManager().bindTexture(((AbstractClientPlayerEntity) target).getLocationSkin());
        AbstractGui.drawScaledCustomSizeModalRect(xPosition + 4, yPosition + 4, 8F, 8F, 8F, 8F, 32, 32, 64F, 64F);
        StencilUtil.uninitStencilBuffer();
        Fonts.gilroyBold[18].drawString(stack, substring, xPosition + 42, yPosition + 7, -1);

        String healthValue = (int) MathUtil.round(this.health * 20 + target.getAbsorptionAmount(), 0.5f) + ".00 HP";
        Fonts.gilroyBold[12].drawCenteredString(stack, healthValue, xPosition + maxWidth - 58, yPosition + maxHeight / 1.5 - 2.2f, ColorUtil.rgba(255, 255, 255, 255));
        GlStateManager.popMatrix();
        this.TargetHUD5.setWidth(maxWidth);
        this.TargetHUD5.setHeight(maxHeight);

    }
Нормик
 
имба
 
Как сделать полоску здоровья меньше а так топ
 
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.

Пожалуйста, зарегистрируйтесь или авторизуйтесь, чтобы увидеть содержимое.


1708274267209.png


:roflanEbalo:
 
Привет форум, решил поиграться со своим худом и добавить минималистичный TargetHud. Здесь крайне простое получение здоровья для отрисовки цвета к каждой категории. И да я знаю, что тут используется Stencil для закругленный головы (это херня я понимаю)

Пожалуйста, авторизуйтесь для просмотра ссылки.

Пожалуйста, авторизуйтесь для просмотра ссылки.

Пожалуйста, авторизуйтесь для просмотра ссылки.


arab:
Expand Collapse Copy
private void onRenderTargetHud5(final MatrixStack stack) {
        this.target = getTarget(this.target);
        this.tagetHudAnimation5.setDuration(300); // чел добавь сюда свою анимацию
        this.scale = tagetHudAnimation3.getOutput();

        if (scale == 0.0F) {
            target = null;
        }

        if (target == null) {
            return;
        }

        final String targetName = this.target.getName().getString();

        String substring = targetName.substring(0, Math.min(targetName.length(), 10));
        final float nameWidth = Fonts.gilroyBold[18].getWidth(substring);
        final float xPosition = this.TargetHUD5.getX();
        final float yPosition = this.TargetHUD5.getY();
        final float maxWidth = Math.max(nameWidth + 45, 114);
        final float maxHeight = 30;

        this.health = AnimationMath.fast(health, target.getHealth() / target.getMaxHealth(), 5);
        this.health = MathHelper.clamp(this.health, 0, 1);
        this.healthplus = AnimationMath.fast(healthplus, target.getAbsorptionAmount() / target.getMaxHealth(), 5);
        this.healthplus = MathHelper.clamp(this.healthplus, 0, 1);

        GlStateManager.pushMatrix();
        AnimationMath.sizeAnimation(xPosition + (maxWidth / 2), yPosition + (maxHeight / 2), scale);

  
        float posX = xPosition;
        float posY = yPosition;
        float width = maxWidth;
        int firstColor = ColorUtil.getColorStyle(0);
        int secondColor = ColorUtil.getColorStyle(90);
        float height = maxHeight + 10;
        int roundDegree = 7;
        int alpha = 140;
        int shadowAlpha = alpha / 2;
        int shadowColor1 = (firstColor & 0xFFFFFF) | (shadowAlpha << 24);
        int shadowColor2 = (secondColor & 0xFFFFFF) | (shadowAlpha << 24);
        int gradientColor = (MenuColorUtil.Theme.bg20.getRGB() & 0xFFFFFF) | (alpha << 24);
        // фон с тенью и свечением
        RenderUtil.Render2D.drawGradientRound(posX, posY, width, height, roundDegree - 1, shadowColor1, gradientColor, gradientColor, shadowColor2);
        // обводка
        RenderUtil.Render2D.drawRoundOutline(posX, posY, width, height, roundDegree, 1, b_color, new Vector4i(Helper.STYLE_MANAGER.getCurrentStyle().getColor(150), Helper.STYLE_MANAGER.getCurrentStyle().getColor(100), Helper.STYLE_MANAGER.getCurrentStyle().getColor(50), Helper.STYLE_MANAGER.getCurrentStyle().getColor(1)));

        float healthBarX = xPosition + 42;
        float healthBarY = yPosition + 26;
        float healthBarWidth = 64 * health;
        float healthBarHeight = 7;

        // тут цвет полосы взависимости от здоровья
        int color;
        if (health >= 0.65f) { // Зеленый 65% и выше
            color = Color.GREEN.getRGB();
        } else if (health >= 0.35f) { // Оранжевый 35%  до 65%
            color = Color.ORANGE.getRGB();
        } else { // Красный для менее 35%
            color = Color.RED.getRGB();
        }
        // кто хочет поставит проценты так как ему надо



        RenderUtil.Render2D.drawRoundedRect(healthBarX, healthBarY, 64, healthBarHeight, 3f, rgba(21, 21, 21, 255));
        RenderUtil.Render2D.drawShadow(healthBarX, healthBarY, healthBarWidth, healthBarHeight, 10, color);
        RenderUtil.Render2D.drawGradientRound(healthBarX, healthBarY, healthBarWidth, healthBarHeight, 3, color, color, color, color);
        RenderUtil.Render2D.drawRoundOutline(posX, posY, width, height, roundDegree, 1, b_color, new Vector4i(Helper.STYLE_MANAGER.getCurrentStyle().getColor(150), Helper.STYLE_MANAGER.getCurrentStyle().getColor(100), Helper.STYLE_MANAGER.getCurrentStyle().getColor(50), Helper.STYLE_MANAGER.getCurrentStyle().getColor(1)));

        // крайне хреновое закругление головы
        StencilUtil.initStencilToWrite();
        RenderUtil.Render2D.drawRoundedRect(xPosition + 4, yPosition + 4, 32, 32, 6, Color.BLACK.getRGB());
        StencilUtil.readStencilBuffer(1);
        IMinecraft.mc.getTextureManager().bindTexture(((AbstractClientPlayerEntity) target).getLocationSkin());
        AbstractGui.drawScaledCustomSizeModalRect(xPosition + 4, yPosition + 4, 8F, 8F, 8F, 8F, 32, 32, 64F, 64F);
        StencilUtil.uninitStencilBuffer();
        Fonts.gilroyBold[18].drawString(stack, substring, xPosition + 42, yPosition + 7, -1);

        String healthValue = (int) MathUtil.round(this.health * 20 + target.getAbsorptionAmount(), 0.5f) + ".00 HP";
        Fonts.gilroyBold[12].drawCenteredString(stack, healthValue, xPosition + maxWidth - 58, yPosition + maxHeight / 1.5 - 2.2f, ColorUtil.rgba(255, 255, 255, 255));
        GlStateManager.popMatrix();
        this.TargetHUD5.setWidth(maxWidth);
        this.TargetHUD5.setHeight(maxHeight);

    }
1708626155452.png

че делать?
 
s:
Expand Collapse Copy
if (health >= 0.65f) { // Зеленый 65% и выше

            color = Color.GREEN.getRGB();

        } else if (health >= 0.35f) { // Оранжевый 35%  до 65%

            color = Color.ORANGE.getRGB();

        } else { // Красный для менее 35%

            color = Color.RED.getRGB();

        }
bruh
 
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
s:
Expand Collapse Copy
if (health >= 0.65f) { // Зеленый 65% и выше

            color = Color.GREEN.getRGB();

        } else if (health >= 0.35f) { // Оранжевый 35%  до 65%

            color = Color.ORANGE.getRGB();

        } else { // Красный для менее 35%

            color = Color.RED.getRGB();

        }
bruh
что не так?
 
Назад
Сверху Снизу