Исходник MainMenu | Exp 3.1

Начинающий
Статус
Оффлайн
Регистрация
10 Окт 2024
Сообщения
12
Реакции[?]
0
Поинты[?]
0
Пожалуйста, авторизуйтесь для просмотра ссылки.

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


code:
package eva.ware.ui.mainmenu;

import eva.ware.utils.client.SoundUtil;
import eva.ware.utils.math.animation.Animation;
import eva.ware.utils.math.animation.util.Easing;
import eva.ware.utils.math.animation.util.Easings;
import eva.ware.utils.shader.ShaderUtil;
import com.mojang.blaze3d.matrix.MatrixStack;

import com.mojang.blaze3d.platform.GlStateManager;
import eva.ware.Evaware;
import eva.ware.utils.client.ClientUtil;
import eva.ware.utils.client.IMinecraft;
import eva.ware.utils.math.Vec2i;
import eva.ware.utils.math.MathUtil;
import eva.ware.utils.math.StopWatch;
import eva.ware.utils.render.color.ColorUtils;
import eva.ware.utils.render.rect.DisplayUtils;
import eva.ware.utils.render.font.Fonts;
import eva.ware.utils.text.BetterText;
import eva.ware.utils.text.font.ClientFonts;
import lombok.Getter;
import net.minecraft.client.MainWindow;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.screen.MultiplayerScreen;
import net.minecraft.client.gui.screen.OptionsScreen;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.screen.WorldSelectionScreen;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.ITextComponent;

import java.util.ArrayList;
import java.util.List;


public class MainScreen extends Screen implements IMinecraft {
    public MainScreen() {
        super(ITextComponent.getTextComponentOrEmpty(""));

    }

    public final StopWatch timer = new StopWatch();
    public static float o = 0;

    private final ResourceLocation backmenu = new ResourceLocation("eva/images/backmenu.png");
    private final List<Button> buttons = new ArrayList<>();


    @Override
    public void init(Minecraft minecraft, int width, int height) {
        super.init(minecraft, width, height);
        float widthButton = 80 / 2f;
        float heightButton = 80 / 2f;
        float x = ClientUtil.calc(width) / 2f - (widthButton * 5 / 2);
        float y = Math.round(ClientUtil.calc(height) / 2f - heightButton / 2);
        buttons.clear();
        buttons.add(new Button(x, y, widthButton, heightButton, "single", () -> {
            mc.displayGuiScreen(new WorldSelectionScreen(this));
        }));
        x += widthButton;
        buttons.add(new Button(x, y, widthButton, heightButton, "multy", () -> {
            mc.displayGuiScreen(new MultiplayerScreen(this));
        }));
        x += widthButton;
        buttons.add(new Button(x, y, widthButton, heightButton, "altmgr", () -> {
            mc.displayGuiScreen(Evaware.getInst().getAltScreen());
        }));
        x += widthButton;
        buttons.add(new Button(x, y, widthButton, heightButton, "settings", () -> {
            mc.displayGuiScreen(new OptionsScreen(this, mc.gameSettings));
        }));
        x += widthButton;
        buttons.add(new Button(x, y, widthButton, heightButton, "quit", mc::shutdownMinecraftApplet));
//        SoundUtil.playSound("mainmenu", 60, true);
    }


    private final StopWatch stopWatch = new StopWatch();
    static boolean start = false;

    @Override
    public boolean mouseScrolled(double mouseX, double mouseY, double delta) {
        return super.mouseScrolled(mouseX, mouseY, delta);
    }

    @Override
    public void render(MatrixStack matrixStack, int mouseX, int mouseY, float partialTicks) {
        super.render(matrixStack, mouseX, mouseY, partialTicks);

        MainWindow mainWindow = mc.getMainWindow();
        DisplayUtils.drawRoundedRect(0,0, mainWindow.getScaledWidth(), mainWindow.getScaledHeight(), 0, ColorUtils.rgb(15, 15, 15));

        mc.gameRenderer.setupOverlayRendering(2);

        for (float i=0;i<1337;i++) {
            if(timer.isReached(10)){
                o++;
                i=0;
                timer.reset();
            }
        }

        GlStateManager.pushMatrix();
        GlStateManager.enableBlend();

        ShaderUtil.MainMenu2Shader.attach();
        ShaderUtil.MainMenu2Shader.setUniform("time", o/20);
        ShaderUtil.MainMenu2Shader.setUniform("width", (float)mainWindow.getWidth());
        ShaderUtil.MainMenu2Shader.setUniform("height", (float)mainWindow.getHeight());

        DisplayUtils.drawQuads(0, 0, mainWindow.getScaledWidth(), mainWindow.getScaledHeight(), 7);

        ShaderUtil.MainMenu2Shader.detach();

        GlStateManager.disableBlend();
        GlStateManager.popMatrix();

        float widthButton = 80 / 2f;
        float heightButton = 80 / 2f;
        float x = ClientUtil.calc(width) / 2f - (widthButton * 5 / 2);
        float y = Math.round(ClientUtil.calc(height) / 2f - heightButton * 2 / 2);

        float widthRect = widthButton * 6;
        float xRect = x - widthButton / 2;
        float heightRect = heightButton * 2;

        DisplayUtils.drawShadow(mainWindow.getScaledWidth() / 2 - 4 - (ClientFonts.msSemiBold[22].getWidth("EvaWare") / 2), y, ClientFonts.msSemiBold[22].getWidth("EvaWare") + 8, ClientFonts.msSemiBold[22].getFontHeight(), 12, ColorUtils.rgba(255, 255, 255, 40));
        DisplayUtils.drawShadow(xRect, y - 5, widthRect, heightRect, 12, ColorUtils.rgba(40, 40, 40, 60));
        DisplayUtils.drawRoundedRect(xRect, y - 5, widthRect, heightRect, 8, ColorUtils.rgba(40, 40, 40, 60));

        ClientFonts.msSemiBold[22].drawCenteredString(matrixStack, "EvaWare", mainWindow.getScaledWidth() / 2, y + 2, -1);
        ClientFonts.msSemiBold[14].drawString(matrixStack, setMessage(), 3, mainWindow.getScaledHeight() - ClientFonts.msSemiBold[14].getFontHeight() + 1, -1);
        drawButtons(matrixStack, mouseX, mouseY, partialTicks);
        mc.gameRenderer.setupOverlayRendering();

    }

    private final BetterText gavno = new BetterText(List.of(
            " <3", " >_<", " UwU", " O_O", " OwO", " :>", " <3", " >w<", "~~"
    ), 2000);

    private String setMessage() {
        gavno.update();
        String emoji = gavno.getOutput().toString();
        String userName = ClientUtil.getUsername() + emoji;

        return ClientUtil.getGreetingMessage() + ", " + userName;
    }

    @Override
    public boolean charTyped(char codePoint, int modifiers) {
        return super.charTyped(codePoint, modifiers);
    }

    @Override
    public boolean keyPressed(int keyCode, int scanCode, int modifiers) {
        return false;
    }

    @Override
    public boolean mouseClicked(double mouseX, double mouseY, int button) {
        Vec2i fixed = ClientUtil.getMouse((int) mouseX, (int) mouseY);
        buttons.forEach(b -> b.click(fixed.getX(), fixed.getY(), button));
        return super.mouseClicked(mouseX, mouseY, button);
    }

    private void drawButtons(MatrixStack stack, int mX, int mY, float pt) {
        buttons.forEach(b -> b.render(stack, mX, mY, pt));
    }

    private class Button {
        [USER=270918]@Getter[/USER]
        private final float x, y, width, height;
        private String text;
        private Runnable action;
        public Animation animation = new Animation();
        boolean hovered;

        public Button(float x, float y, float width, float height, String text, Runnable action) {
            this.x = x;
            this.y = y;
            this.width = width;
            this.height = height;
            this.text = text;
            this.action = action;
        }

        public void render(MatrixStack stack, int mouseX, int mouseY, float pt) {
            animation.update();
            animation.run(hovered ? 1 : 0, hovered ? 0.25f : 0.5, Easings.BACK_OUT);
            hovered = MathUtil.isHovered(mouseX, mouseY, x, y, width, height);
            float hoverSize = (float) (2.5f * animation.getValue());
            float textY = (float) (y + height - 1 + 3 * animation.getValue());
            int interColor = ColorUtils.interpolateColor(-1, ColorUtils.rgb(160, 160, 160), (float) animation.getValue());

            DisplayUtils.drawShadow(x, y, width, height, 10, ColorUtils.rgba(90, 90, 90, 70));
            DisplayUtils.drawRoundedRect(x, y, width, height, 6, ColorUtils.rgba(90, 90, 90, 70));
            ClientFonts.tenacity[18].drawCenteredString(stack, text, x + width / 2f, textY, ColorUtils.setAlpha(interColor, (int) (255 * animation.getValue())));
            DisplayUtils.drawImage(new ResourceLocation("eva/images/mainmenu/" + text + ".png"), x + 5 - hoverSize, y + 5 - hoverSize, width - 10 + hoverSize * 2, height - 10 + hoverSize * 2, interColor);
        }

        public void click(int mouseX, int mouseY, int button) {
            if (MathUtil.isHovered(mouseX, mouseY, x, y, width, height)) {
                action.run();
                SoundUtil.playSound("buttonclick.wav", .1f);
            }
        }

    }

}
привет друг расскажи пожалуйста куда этот код вставлять?
 
Начинающий
Статус
Оффлайн
Регистрация
24 Окт 2021
Сообщения
134
Реакции[?]
1
Поинты[?]
1K
Пожалуйста, авторизуйтесь для просмотра ссылки.

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


code:
package eva.ware.ui.mainmenu;

import eva.ware.utils.client.SoundUtil;
import eva.ware.utils.math.animation.Animation;
import eva.ware.utils.math.animation.util.Easing;
import eva.ware.utils.math.animation.util.Easings;
import eva.ware.utils.shader.ShaderUtil;
import com.mojang.blaze3d.matrix.MatrixStack;

import com.mojang.blaze3d.platform.GlStateManager;
import eva.ware.Evaware;
import eva.ware.utils.client.ClientUtil;
import eva.ware.utils.client.IMinecraft;
import eva.ware.utils.math.Vec2i;
import eva.ware.utils.math.MathUtil;
import eva.ware.utils.math.StopWatch;
import eva.ware.utils.render.color.ColorUtils;
import eva.ware.utils.render.rect.DisplayUtils;
import eva.ware.utils.render.font.Fonts;
import eva.ware.utils.text.BetterText;
import eva.ware.utils.text.font.ClientFonts;
import lombok.Getter;
import net.minecraft.client.MainWindow;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.screen.MultiplayerScreen;
import net.minecraft.client.gui.screen.OptionsScreen;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.screen.WorldSelectionScreen;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.ITextComponent;

import java.util.ArrayList;
import java.util.List;


public class MainScreen extends Screen implements IMinecraft {
    public MainScreen() {
        super(ITextComponent.getTextComponentOrEmpty(""));

    }

    public final StopWatch timer = new StopWatch();
    public static float o = 0;

    private final ResourceLocation backmenu = new ResourceLocation("eva/images/backmenu.png");
    private final List<Button> buttons = new ArrayList<>();


    @Override
    public void init(Minecraft minecraft, int width, int height) {
        super.init(minecraft, width, height);
        float widthButton = 80 / 2f;
        float heightButton = 80 / 2f;
        float x = ClientUtil.calc(width) / 2f - (widthButton * 5 / 2);
        float y = Math.round(ClientUtil.calc(height) / 2f - heightButton / 2);
        buttons.clear();
        buttons.add(new Button(x, y, widthButton, heightButton, "single", () -> {
            mc.displayGuiScreen(new WorldSelectionScreen(this));
        }));
        x += widthButton;
        buttons.add(new Button(x, y, widthButton, heightButton, "multy", () -> {
            mc.displayGuiScreen(new MultiplayerScreen(this));
        }));
        x += widthButton;
        buttons.add(new Button(x, y, widthButton, heightButton, "altmgr", () -> {
            mc.displayGuiScreen(Evaware.getInst().getAltScreen());
        }));
        x += widthButton;
        buttons.add(new Button(x, y, widthButton, heightButton, "settings", () -> {
            mc.displayGuiScreen(new OptionsScreen(this, mc.gameSettings));
        }));
        x += widthButton;
        buttons.add(new Button(x, y, widthButton, heightButton, "quit", mc::shutdownMinecraftApplet));
//        SoundUtil.playSound("mainmenu", 60, true);
    }


    private final StopWatch stopWatch = new StopWatch();
    static boolean start = false;

    @Override
    public boolean mouseScrolled(double mouseX, double mouseY, double delta) {
        return super.mouseScrolled(mouseX, mouseY, delta);
    }

    @Override
    public void render(MatrixStack matrixStack, int mouseX, int mouseY, float partialTicks) {
        super.render(matrixStack, mouseX, mouseY, partialTicks);

        MainWindow mainWindow = mc.getMainWindow();
        DisplayUtils.drawRoundedRect(0,0, mainWindow.getScaledWidth(), mainWindow.getScaledHeight(), 0, ColorUtils.rgb(15, 15, 15));

        mc.gameRenderer.setupOverlayRendering(2);

        for (float i=0;i<1337;i++) {
            if(timer.isReached(10)){
                o++;
                i=0;
                timer.reset();
            }
        }

        GlStateManager.pushMatrix();
        GlStateManager.enableBlend();

        ShaderUtil.MainMenu2Shader.attach();
        ShaderUtil.MainMenu2Shader.setUniform("time", o/20);
        ShaderUtil.MainMenu2Shader.setUniform("width", (float)mainWindow.getWidth());
        ShaderUtil.MainMenu2Shader.setUniform("height", (float)mainWindow.getHeight());

        DisplayUtils.drawQuads(0, 0, mainWindow.getScaledWidth(), mainWindow.getScaledHeight(), 7);

        ShaderUtil.MainMenu2Shader.detach();

        GlStateManager.disableBlend();
        GlStateManager.popMatrix();

        float widthButton = 80 / 2f;
        float heightButton = 80 / 2f;
        float x = ClientUtil.calc(width) / 2f - (widthButton * 5 / 2);
        float y = Math.round(ClientUtil.calc(height) / 2f - heightButton * 2 / 2);

        float widthRect = widthButton * 6;
        float xRect = x - widthButton / 2;
        float heightRect = heightButton * 2;

        DisplayUtils.drawShadow(mainWindow.getScaledWidth() / 2 - 4 - (ClientFonts.msSemiBold[22].getWidth("EvaWare") / 2), y, ClientFonts.msSemiBold[22].getWidth("EvaWare") + 8, ClientFonts.msSemiBold[22].getFontHeight(), 12, ColorUtils.rgba(255, 255, 255, 40));
        DisplayUtils.drawShadow(xRect, y - 5, widthRect, heightRect, 12, ColorUtils.rgba(40, 40, 40, 60));
        DisplayUtils.drawRoundedRect(xRect, y - 5, widthRect, heightRect, 8, ColorUtils.rgba(40, 40, 40, 60));

        ClientFonts.msSemiBold[22].drawCenteredString(matrixStack, "EvaWare", mainWindow.getScaledWidth() / 2, y + 2, -1);
        ClientFonts.msSemiBold[14].drawString(matrixStack, setMessage(), 3, mainWindow.getScaledHeight() - ClientFonts.msSemiBold[14].getFontHeight() + 1, -1);
        drawButtons(matrixStack, mouseX, mouseY, partialTicks);
        mc.gameRenderer.setupOverlayRendering();

    }

    private final BetterText gavno = new BetterText(List.of(
            " <3", " >_<", " UwU", " O_O", " OwO", " :>", " <3", " >w<", "~~"
    ), 2000);

    private String setMessage() {
        gavno.update();
        String emoji = gavno.getOutput().toString();
        String userName = ClientUtil.getUsername() + emoji;

        return ClientUtil.getGreetingMessage() + ", " + userName;
    }

    @Override
    public boolean charTyped(char codePoint, int modifiers) {
        return super.charTyped(codePoint, modifiers);
    }

    @Override
    public boolean keyPressed(int keyCode, int scanCode, int modifiers) {
        return false;
    }

    @Override
    public boolean mouseClicked(double mouseX, double mouseY, int button) {
        Vec2i fixed = ClientUtil.getMouse((int) mouseX, (int) mouseY);
        buttons.forEach(b -> b.click(fixed.getX(), fixed.getY(), button));
        return super.mouseClicked(mouseX, mouseY, button);
    }

    private void drawButtons(MatrixStack stack, int mX, int mY, float pt) {
        buttons.forEach(b -> b.render(stack, mX, mY, pt));
    }

    private class Button {
        [USER=270918]@Getter[/USER]
        private final float x, y, width, height;
        private String text;
        private Runnable action;
        public Animation animation = new Animation();
        boolean hovered;

        public Button(float x, float y, float width, float height, String text, Runnable action) {
            this.x = x;
            this.y = y;
            this.width = width;
            this.height = height;
            this.text = text;
            this.action = action;
        }

        public void render(MatrixStack stack, int mouseX, int mouseY, float pt) {
            animation.update();
            animation.run(hovered ? 1 : 0, hovered ? 0.25f : 0.5, Easings.BACK_OUT);
            hovered = MathUtil.isHovered(mouseX, mouseY, x, y, width, height);
            float hoverSize = (float) (2.5f * animation.getValue());
            float textY = (float) (y + height - 1 + 3 * animation.getValue());
            int interColor = ColorUtils.interpolateColor(-1, ColorUtils.rgb(160, 160, 160), (float) animation.getValue());

            DisplayUtils.drawShadow(x, y, width, height, 10, ColorUtils.rgba(90, 90, 90, 70));
            DisplayUtils.drawRoundedRect(x, y, width, height, 6, ColorUtils.rgba(90, 90, 90, 70));
            ClientFonts.tenacity[18].drawCenteredString(stack, text, x + width / 2f, textY, ColorUtils.setAlpha(interColor, (int) (255 * animation.getValue())));
            DisplayUtils.drawImage(new ResourceLocation("eva/images/mainmenu/" + text + ".png"), x + 5 - hoverSize, y + 5 - hoverSize, width - 10 + hoverSize * 2, height - 10 + hoverSize * 2, interColor);
        }

        public void click(int mouseX, int mouseY, int button) {
            if (MathUtil.isHovered(mouseX, mouseY, x, y, width, height)) {
                action.run();
                SoundUtil.playSound("buttonclick.wav", .1f);
            }
        }

    }

}
Спасибки, уже запастил
привет друг расскажи пожалуйста куда этот код вставлять?
В мейнменю
 
Начинающий
Статус
Оффлайн
Регистрация
10 Окт 2024
Сообщения
12
Реакции[?]
0
Поинты[?]
0
Бро не папку а класс :roflanPominki:
это в интел айдж идея такая синяя штучка да? извини меня я новичок и даже таких эллементарных вещей не понимаю
вот мой телеграмм trsahkесли что
научите пастингу кто-то :3
Бро не папку а класс :roflanPominki:
в "MainMenuScreen"?
 
Начинающий
Статус
Оффлайн
Регистрация
7 Дек 2023
Сообщения
3
Реакции[?]
0
Поинты[?]
0
пацаны, хочу сделать MainScreen как в новом нурике, кто то знает как написать аннимированный переливающийся текст в мейн меню без шейдеров?
 
Начинающий
Статус
Оффлайн
Регистрация
21 Дек 2023
Сообщения
11
Реакции[?]
0
Поинты[?]
0
Пожалуйста, авторизуйтесь для просмотра ссылки.

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


code:
package eva.ware.ui.mainmenu;

import eva.ware.utils.client.SoundUtil;
import eva.ware.utils.math.animation.Animation;
import eva.ware.utils.math.animation.util.Easing;
import eva.ware.utils.math.animation.util.Easings;
import eva.ware.utils.shader.ShaderUtil;
import com.mojang.blaze3d.matrix.MatrixStack;

import com.mojang.blaze3d.platform.GlStateManager;
import eva.ware.Evaware;
import eva.ware.utils.client.ClientUtil;
import eva.ware.utils.client.IMinecraft;
import eva.ware.utils.math.Vec2i;
import eva.ware.utils.math.MathUtil;
import eva.ware.utils.math.StopWatch;
import eva.ware.utils.render.color.ColorUtils;
import eva.ware.utils.render.rect.DisplayUtils;
import eva.ware.utils.render.font.Fonts;
import eva.ware.utils.text.BetterText;
import eva.ware.utils.text.font.ClientFonts;
import lombok.Getter;
import net.minecraft.client.MainWindow;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.screen.MultiplayerScreen;
import net.minecraft.client.gui.screen.OptionsScreen;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.screen.WorldSelectionScreen;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.ITextComponent;

import java.util.ArrayList;
import java.util.List;


public class MainScreen extends Screen implements IMinecraft {
    public MainScreen() {
        super(ITextComponent.getTextComponentOrEmpty(""));

    }

    public final StopWatch timer = new StopWatch();
    public static float o = 0;

    private final ResourceLocation backmenu = new ResourceLocation("eva/images/backmenu.png");
    private final List<Button> buttons = new ArrayList<>();


    @Override
    public void init(Minecraft minecraft, int width, int height) {
        super.init(minecraft, width, height);
        float widthButton = 80 / 2f;
        float heightButton = 80 / 2f;
        float x = ClientUtil.calc(width) / 2f - (widthButton * 5 / 2);
        float y = Math.round(ClientUtil.calc(height) / 2f - heightButton / 2);
        buttons.clear();
        buttons.add(new Button(x, y, widthButton, heightButton, "single", () -> {
            mc.displayGuiScreen(new WorldSelectionScreen(this));
        }));
        x += widthButton;
        buttons.add(new Button(x, y, widthButton, heightButton, "multy", () -> {
            mc.displayGuiScreen(new MultiplayerScreen(this));
        }));
        x += widthButton;
        buttons.add(new Button(x, y, widthButton, heightButton, "altmgr", () -> {
            mc.displayGuiScreen(Evaware.getInst().getAltScreen());
        }));
        x += widthButton;
        buttons.add(new Button(x, y, widthButton, heightButton, "settings", () -> {
            mc.displayGuiScreen(new OptionsScreen(this, mc.gameSettings));
        }));
        x += widthButton;
        buttons.add(new Button(x, y, widthButton, heightButton, "quit", mc::shutdownMinecraftApplet));
//        SoundUtil.playSound("mainmenu", 60, true);
    }


    private final StopWatch stopWatch = new StopWatch();
    static boolean start = false;

    @Override
    public boolean mouseScrolled(double mouseX, double mouseY, double delta) {
        return super.mouseScrolled(mouseX, mouseY, delta);
    }

    @Override
    public void render(MatrixStack matrixStack, int mouseX, int mouseY, float partialTicks) {
        super.render(matrixStack, mouseX, mouseY, partialTicks);

        MainWindow mainWindow = mc.getMainWindow();
        DisplayUtils.drawRoundedRect(0,0, mainWindow.getScaledWidth(), mainWindow.getScaledHeight(), 0, ColorUtils.rgb(15, 15, 15));

        mc.gameRenderer.setupOverlayRendering(2);

        for (float i=0;i<1337;i++) {
            if(timer.isReached(10)){
                o++;
                i=0;
                timer.reset();
            }
        }

        GlStateManager.pushMatrix();
        GlStateManager.enableBlend();

        ShaderUtil.MainMenu2Shader.attach();
        ShaderUtil.MainMenu2Shader.setUniform("time", o/20);
        ShaderUtil.MainMenu2Shader.setUniform("width", (float)mainWindow.getWidth());
        ShaderUtil.MainMenu2Shader.setUniform("height", (float)mainWindow.getHeight());

        DisplayUtils.drawQuads(0, 0, mainWindow.getScaledWidth(), mainWindow.getScaledHeight(), 7);

        ShaderUtil.MainMenu2Shader.detach();

        GlStateManager.disableBlend();
        GlStateManager.popMatrix();

        float widthButton = 80 / 2f;
        float heightButton = 80 / 2f;
        float x = ClientUtil.calc(width) / 2f - (widthButton * 5 / 2);
        float y = Math.round(ClientUtil.calc(height) / 2f - heightButton * 2 / 2);

        float widthRect = widthButton * 6;
        float xRect = x - widthButton / 2;
        float heightRect = heightButton * 2;

        DisplayUtils.drawShadow(mainWindow.getScaledWidth() / 2 - 4 - (ClientFonts.msSemiBold[22].getWidth("EvaWare") / 2), y, ClientFonts.msSemiBold[22].getWidth("EvaWare") + 8, ClientFonts.msSemiBold[22].getFontHeight(), 12, ColorUtils.rgba(255, 255, 255, 40));
        DisplayUtils.drawShadow(xRect, y - 5, widthRect, heightRect, 12, ColorUtils.rgba(40, 40, 40, 60));
        DisplayUtils.drawRoundedRect(xRect, y - 5, widthRect, heightRect, 8, ColorUtils.rgba(40, 40, 40, 60));

        ClientFonts.msSemiBold[22].drawCenteredString(matrixStack, "EvaWare", mainWindow.getScaledWidth() / 2, y + 2, -1);
        ClientFonts.msSemiBold[14].drawString(matrixStack, setMessage(), 3, mainWindow.getScaledHeight() - ClientFonts.msSemiBold[14].getFontHeight() + 1, -1);
        drawButtons(matrixStack, mouseX, mouseY, partialTicks);
        mc.gameRenderer.setupOverlayRendering();

    }

    private final BetterText gavno = new BetterText(List.of(
            " <3", " >_<", " UwU", " O_O", " OwO", " :>", " <3", " >w<", "~~"
    ), 2000);

    private String setMessage() {
        gavno.update();
        String emoji = gavno.getOutput().toString();
        String userName = ClientUtil.getUsername() + emoji;

        return ClientUtil.getGreetingMessage() + ", " + userName;
    }

    @Override
    public boolean charTyped(char codePoint, int modifiers) {
        return super.charTyped(codePoint, modifiers);
    }

    @Override
    public boolean keyPressed(int keyCode, int scanCode, int modifiers) {
        return false;
    }

    @Override
    public boolean mouseClicked(double mouseX, double mouseY, int button) {
        Vec2i fixed = ClientUtil.getMouse((int) mouseX, (int) mouseY);
        buttons.forEach(b -> b.click(fixed.getX(), fixed.getY(), button));
        return super.mouseClicked(mouseX, mouseY, button);
    }

    private void drawButtons(MatrixStack stack, int mX, int mY, float pt) {
        buttons.forEach(b -> b.render(stack, mX, mY, pt));
    }

    private class Button {
        [USER=270918]@Getter[/USER]
        private final float x, y, width, height;
        private String text;
        private Runnable action;
        public Animation animation = new Animation();
        boolean hovered;

        public Button(float x, float y, float width, float height, String text, Runnable action) {
            this.x = x;
            this.y = y;
            this.width = width;
            this.height = height;
            this.text = text;
            this.action = action;
        }

        public void render(MatrixStack stack, int mouseX, int mouseY, float pt) {
            animation.update();
            animation.run(hovered ? 1 : 0, hovered ? 0.25f : 0.5, Easings.BACK_OUT);
            hovered = MathUtil.isHovered(mouseX, mouseY, x, y, width, height);
            float hoverSize = (float) (2.5f * animation.getValue());
            float textY = (float) (y + height - 1 + 3 * animation.getValue());
            int interColor = ColorUtils.interpolateColor(-1, ColorUtils.rgb(160, 160, 160), (float) animation.getValue());

            DisplayUtils.drawShadow(x, y, width, height, 10, ColorUtils.rgba(90, 90, 90, 70));
            DisplayUtils.drawRoundedRect(x, y, width, height, 6, ColorUtils.rgba(90, 90, 90, 70));
            ClientFonts.tenacity[18].drawCenteredString(stack, text, x + width / 2f, textY, ColorUtils.setAlpha(interColor, (int) (255 * animation.getValue())));
            DisplayUtils.drawImage(new ResourceLocation("eva/images/mainmenu/" + text + ".png"), x + 5 - hoverSize, y + 5 - hoverSize, width - 10 + hoverSize * 2, height - 10 + hoverSize * 2, interColor);
        }

        public void click(int mouseX, int mouseY, int button) {
            if (MathUtil.isHovered(mouseX, mouseY, x, y, width, height)) {
                action.run();
                SoundUtil.playSound("buttonclick.wav", .1f);
            }
        }

    }

}
скинь altmmanager
 
Сверху Снизу