Подведи собственные итоги года совместно с YOUGAME и забери ценные призы! Перейти

Вопрос Как поставить анимацию на худ?

Начинающий
Начинающий
Статус
Оффлайн
Регистрация
17 Апр 2023
Сообщения
284
Реакции
3
как поставить анимацию на худ?

hud:
Expand Collapse Copy
EsliSpastishLOX.getInstance().scaleMath.pushScale();
            float width = 100;
            float height2 = 10;

            float x = drag.getX();
            float y = drag.getY();

            for (PotionEffect effect : mc.player.getActivePotionEffects()) {
                height2 += 15;
            }
            drag.setWidth(width);
            drag.setHeight(height2);
            offset = AnimationMath.fast(offset, height2, 15f);
// вставление анимации
            GlStateManager.pushMatrix();
            sizeAnimation(x + width + 5, y + offset + 5, animation.getAnimationd(0));

            if (animation.getAnimationd(0) > 0)
            {
//            GlowUtility.drawGlow(x, y, width, offset, 15, ColorUtility.rgba(25, 25, 25, 255));
                SmartScissor.push();
                SmartScissor.setFromComponentCoordinates((int) x - 3, (int) y - 3, (int) width + 6, (int) offset + 6);
                RenderUtility.drawlutiround(x, y, width, offset, 3);
                Fonts.SEMI_BOLD_14.drawCenteredString("Potion Status", x + width / 2, y + 3, ColorUtility.rgba(255, 255, 255, 155));

                if (height2 > 10) {
                    RenderUtility.verticalGradient(x, y + 10, width, 5, ColorUtility.rgba(0, 0, 0, 50), ColorUtility.rgba(0, 0, 0, 0));
                    int offset = 0;
                    for (PotionEffect effect : mc.player.getActivePotionEffects()) {

                        Fonts.SEMI_BOLD_12.drawString(I18n.format(effect.getEffectName()) + " " + getPotionAmplifer(effect), x + 5, y + 16 + offset, ColorUtility.rgba(255, 255, 255, 255));

                        Fonts.SEMI_BOLD_12.drawString(getPotionTime(effect), x + width - Fonts.RUBIK_14.getStringWidth(getPotionTime(effect)) - 5, y + 16 + offset, ColorUtility.rgba(255, 255, 255, 100));

                        offset += 15;
                        height2 += 15;
                    }
                }
                SmartScissor.unset();
                SmartScissor.pop();
                hEsliSpastishLOX.getInstance().scaleMath.popScale();
            }
            GlStateManager.popMatrix();


sizeAnimation:
Expand Collapse Copy
    public static void sizeAnimation(double width, double height, double animation) {
        GL11.glTranslated(width, height, 0);
        GL11.glScaled(animation, animation, 1);
        GL11.glTranslated(-width, -height, 0);
    }

betteranimation:
Expand Collapse Copy
    public static double dropAnimation(double value) {
        double c1 = 1.70158;
        double c3 = 2.70158;
        return 1 + c3 * Math.pow(value - 1, 3) + c1 * Math.pow(value - 1, 2);
    }
    public double getAnimationd(int a) {
        return dropAnimation((this.prevTick + (this.tick - this.prevTick) * Minecraft.getMinecraft().getRenderPartialTicks()) / maxTick);
    }
изменено:
типа когда ставлю анимацию весь potionhud исчезает
 
Последнее редактирование:
Назад
Сверху Снизу