Визуальная часть Widget(кнопки) | Expa 3.1 READY

  • Автор темы Автор темы Fl0rence
  • Дата начала Дата начала
Начинающий
Начинающий
Статус
Оффлайн
Регистрация
30 Апр 2025
Сообщения
3
Реакции
0
Выберите загрузчик игры
  1. ForgeOptiFine

Перед прочтением основного контента ниже, пожалуйста, обратите внимание на обновление внутри секции Майна на нашем форуме. У нас появились:

  • бесплатные читы для Майнкрафт — любое использование на свой страх и риск;
  • маркетплейс Майнкрафт — абсолютно любая коммерция, связанная с игрой, за исключением продажи читов (аккаунты, предоставления услуг, поиск кодеров читов и так далее);
  • приватные читы для Minecraft — в этом разделе только платные хаки для игры, покупайте группу "Продавец" и выставляйте на продажу свой софт;
  • обсуждения и гайды — всё тот же раздел с вопросами, но теперь модернизированный: поиск нужных хаков, пати с игроками-читерами и другая полезная информация.

Спасибо!

Короче всем привет,я решил усовершенствовать код @bloodytraxaet теперь кнопки подсвечиваются плавно при наводке:bayan:

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


(Извините,я новичек в этой теме)

Java:
Expand Collapse Copy
private float animationProgress = 0.0f;
    public void renderButton(MatrixStack matrixStack, int mouseX, int mouseY, float partialTicks) {
        Minecraft minecraft = Minecraft.getInstance();
        FontRenderer fontrenderer = minecraft.fontRenderer;
        minecraft.getTextureManager().bindTexture(WIDGETS_LOCATION);
        RenderSystem.color4f(1.0F, 1.0F, 1.0F, this.alpha);
        RenderSystem.enableBlend();
        RenderSystem.defaultBlendFunc();
        RenderSystem.enableDepthTest();
        // Update animation progress
        float targetProgress = this.isHovered ? 1.0f : 0.0f;
        animationProgress = MathHelper.lerp(0.2f, animationProgress, targetProgress);
        // Interpolate color
        int r = (int) MathHelper.lerp(animationProgress, 16, 40);
        int g = (int) MathHelper.lerp(animationProgress, 16, 40);
        int b = (int) MathHelper.lerp(animationProgress, 16, 40);
        DisplayUtils.drawRoundedRect(this.x-0.5f, this.y-0.9f, this.width+2 / 2, this.height+1.5f, 4.5f, ColorUtils.setAlpha(ColorUtils.getColor(0), 212)); //out
        DisplayUtils.drawShadow(this.x-0.5f, this.y-0.5f, this.width+2 / 2, this.height+2, 5, ColorUtils.setAlpha(ColorUtils.getColor(0), 100)); //out
        DisplayUtils.drawRoundedRect(this.x, this.y, this.width, this.height, 4, ColorUtils.rgb(r, g, b));
        this.renderBg(matrixStack, minecraft, mouseX, mouseY);
        int j = this.active ? 16777215 : 10526880;
        drawCenteredString(matrixStack, fontrenderer, this.getMessage(), this.x + this.width / 2, this.y + (this.height - 8) / 2, j | MathHelper.ceil(this.alpha * 255.0F) << 24);
    }
 
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
/del
 
похожие сливали
а прочитал до конца, понятно
 
Короче всем привет,я решил усовершенствовать код @bloodytraxaet теперь кнопки подсвечиваются плавно при наводке:bayan:

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


(Извините,я новичек в этой теме)

Java:
Expand Collapse Copy
private float animationProgress = 0.0f;
    public void renderButton(MatrixStack matrixStack, int mouseX, int mouseY, float partialTicks) {
        Minecraft minecraft = Minecraft.getInstance();
        FontRenderer fontrenderer = minecraft.fontRenderer;
        minecraft.getTextureManager().bindTexture(WIDGETS_LOCATION);
        RenderSystem.color4f(1.0F, 1.0F, 1.0F, this.alpha);
        RenderSystem.enableBlend();
        RenderSystem.defaultBlendFunc();
        RenderSystem.enableDepthTest();
        // Update animation progress
        float targetProgress = this.isHovered ? 1.0f : 0.0f;
        animationProgress = MathHelper.lerp(0.2f, animationProgress, targetProgress);
        // Interpolate color
        int r = (int) MathHelper.lerp(animationProgress, 16, 40);
        int g = (int) MathHelper.lerp(animationProgress, 16, 40);
        int b = (int) MathHelper.lerp(animationProgress, 16, 40);
        DisplayUtils.drawRoundedRect(this.x-0.5f, this.y-0.9f, this.width+2 / 2, this.height+1.5f, 4.5f, ColorUtils.setAlpha(ColorUtils.getColor(0), 212)); //out
        DisplayUtils.drawShadow(this.x-0.5f, this.y-0.5f, this.width+2 / 2, this.height+2, 5, ColorUtils.setAlpha(ColorUtils.getColor(0), 100)); //out
        DisplayUtils.drawRoundedRect(this.x, this.y, this.width, this.height, 4, ColorUtils.rgb(r, g, b));
        this.renderBg(matrixStack, minecraft, mouseX, mouseY);
        int j = this.active ? 16777215 : 10526880;
        drawCenteredString(matrixStack, fontrenderer, this.getMessage(), this.x + this.width / 2, this.y + (this.height - 8) / 2, j | MathHelper.ceil(this.alpha * 255.0F) << 24);
    }
пойдет
 
1746696125266.png


вот щас красивее стало вот обновленный код
Java:
Expand Collapse Copy
    private float animationProgress = 0.0f;
    public void renderButton(MatrixStack matrixStack, int mouseX, int mouseY, float partialTicks) {
        Minecraft minecraft = Minecraft.getInstance();
        minecraft.getTextureManager().bindTexture(WIDGETS_LOCATION);
        RenderSystem.color4f(1.0F, 1.0F, 1.0F, this.alpha);
        RenderSystem.enableBlend();
        RenderSystem.defaultBlendFunc();
        RenderSystem.enableDepthTest();
        // Update animation progress
        float targetProgress = this.isHovered ? 1.0f : 0.0f;
        animationProgress = MathHelper.lerp(0.2f, animationProgress, targetProgress);
        // Interpolate color
        int r = (int) MathHelper.lerp(animationProgress, 16, 40);
        int g = (int) MathHelper.lerp(animationProgress, 16, 40);
        int b = (int) MathHelper.lerp(animationProgress, 16, 40);
        RenderUtility.drawRoundedRect(this.x-0.5f, this.y-0.9f, this.width+2 / 2, this.height+1.5f, 4.5f, ColorUtility.setAlpha(ColorUtility.getColor(0), 212)); //out
        RenderUtility.drawShadow(this.x-0.5f, this.y-0.5f, this.width+2 / 2, this.height+2, 5, ColorUtility.setAlpha(ColorUtility.getColor(0), 100)); //out
        RenderUtility.drawRoundedRect(this.x, this.y, this.width, this.height, 4, ColorUtility.rgb(r, g, b));
        this.renderBg(matrixStack, minecraft, mouseX, mouseY);
        int j = this.active ? 16777215 : 10526880;
        ClientFonts.tenacity[18].drawCenteredString(matrixStack, this.getMessage(), this.x + this.width / 2, this.y + 0.5f + (this.height - 8) / 2, -1);

    }
 
Посмотреть вложение 305786

вот щас красивее стало вот обновленный код
Java:
Expand Collapse Copy
    private float animationProgress = 0.0f;
    public void renderButton(MatrixStack matrixStack, int mouseX, int mouseY, float partialTicks) {
        Minecraft minecraft = Minecraft.getInstance();
        minecraft.getTextureManager().bindTexture(WIDGETS_LOCATION);
        RenderSystem.color4f(1.0F, 1.0F, 1.0F, this.alpha);
        RenderSystem.enableBlend();
        RenderSystem.defaultBlendFunc();
        RenderSystem.enableDepthTest();
        // Update animation progress
        float targetProgress = this.isHovered ? 1.0f : 0.0f;
        animationProgress = MathHelper.lerp(0.2f, animationProgress, targetProgress);
        // Interpolate color
        int r = (int) MathHelper.lerp(animationProgress, 16, 40);
        int g = (int) MathHelper.lerp(animationProgress, 16, 40);
        int b = (int) MathHelper.lerp(animationProgress, 16, 40);
        RenderUtility.drawRoundedRect(this.x-0.5f, this.y-0.9f, this.width+2 / 2, this.height+1.5f, 4.5f, ColorUtility.setAlpha(ColorUtility.getColor(0), 212)); //out
        RenderUtility.drawShadow(this.x-0.5f, this.y-0.5f, this.width+2 / 2, this.height+2, 5, ColorUtility.setAlpha(ColorUtility.getColor(0), 100)); //out
        RenderUtility.drawRoundedRect(this.x, this.y, this.width, this.height, 4, ColorUtility.rgb(r, g, b));
        this.renderBg(matrixStack, minecraft, mouseX, mouseY);
        int j = this.active ? 16777215 : 10526880;
        ClientFonts.tenacity[18].drawCenteredString(matrixStack, this.getMessage(), this.x + this.width / 2, this.y + 0.5f + (this.height - 8) / 2, -1);

    }
ии момент
 
куда это совать бля
 
а если рил?
 
В КАКОЙ МОДУЛЬ ЭТУ ПИХАТЬ
 
Посмотреть вложение 305786

вот щас красивее стало вот обновленный код
Java:
Expand Collapse Copy
    private float animationProgress = 0.0f;
    public void renderButton(MatrixStack matrixStack, int mouseX, int mouseY, float partialTicks) {
        Minecraft minecraft = Minecraft.getInstance();
        minecraft.getTextureManager().bindTexture(WIDGETS_LOCATION);
        RenderSystem.color4f(1.0F, 1.0F, 1.0F, this.alpha);
        RenderSystem.enableBlend();
        RenderSystem.defaultBlendFunc();
        RenderSystem.enableDepthTest();
        // Update animation progress
        float targetProgress = this.isHovered ? 1.0f : 0.0f;
        animationProgress = MathHelper.lerp(0.2f, animationProgress, targetProgress);
        // Interpolate color
        int r = (int) MathHelper.lerp(animationProgress, 16, 40);
        int g = (int) MathHelper.lerp(animationProgress, 16, 40);
        int b = (int) MathHelper.lerp(animationProgress, 16, 40);
        RenderUtility.drawRoundedRect(this.x-0.5f, this.y-0.9f, this.width+2 / 2, this.height+1.5f, 4.5f, ColorUtility.setAlpha(ColorUtility.getColor(0), 212)); //out
        RenderUtility.drawShadow(this.x-0.5f, this.y-0.5f, this.width+2 / 2, this.height+2, 5, ColorUtility.setAlpha(ColorUtility.getColor(0), 100)); //out
        RenderUtility.drawRoundedRect(this.x, this.y, this.width, this.height, 4, ColorUtility.rgb(r, g, b));
        this.renderBg(matrixStack, minecraft, mouseX, mouseY);
        int j = this.active ? 16777215 : 10526880;
        ClientFonts.tenacity[18].drawCenteredString(matrixStack, this.getMessage(), this.x + this.width / 2, this.y + 0.5f + (this.height - 8) / 2, -1);

    }

Если не сложно, подскажи что такое ClientFonts , RenderUtility ? Есть ли они в обычных сурсах экспы? Где они находятся?
 
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
как вседа дристня брат (хейт) /del
 
КУДА ЭТО ПИХАТЬ?
 
Назад
Сверху Снизу