Ку всем, моя первая работа в сфере худа. Внизу я скинул шаблон, в других файлах заполняем также. По вопросам дс craftlez122 (Пишите сразу, а не кидайте др пж) package im.expensive.ui.display.impl; import com.mojang.blaze3d.matrix.MatrixStack; import im.expensive.Expensive; import im.expensive.events.EventDisplay; import im.expensive.functions.api.Function; import im.expensive.functions.api.FunctionRegistry; import im.expensive.ui.display.ElementRenderer; import im.expensive.ui.styles.Style; import im.expensive.utils.client.KeyStorage; import im.expensive.utils.drag.Dragging; import im.expensive.utils.render.ColorUtils; import im.expensive.utils.render.DisplayUtils; import im.expensive.utils.render.Scissor; import im.expensive.utils.render.font.Fonts; import im.expensive.utils.text.GradientUtil; import lombok.AccessLevel; import lombok.RequiredArgsConstructor; import lombok.experimental.FieldDefaults; import net.minecraft.client.gui.screen.ChatScreen; import net.minecraft.util.ResourceLocation; import net.minecraft.util.text.ITextComponent; @FieldDefaults(level = AccessLevel.PRIVATE) @RequiredArgsConstructor public class KeyBindRenderer implements ElementRenderer { final Dragging dragging; final ResourceLocation grab = new ResourceLocation("expensive/images/hud/grab.png"); float width; float height; @Override public void render(EventDisplay eventDisplay) { MatrixStack ms = eventDisplay.getMatrixStack(); float posX = dragging.getX(); float posY = dragging.getY(); float fontSize = 6.5f; float padding = 5; ITextComponent name = GradientUtil.gradient("HotKeys"); Style style = Expensive.getInstance().getStyleManager().getCurrentStyle(); //DisplayUtils.drawShadow(posX, posY, width, height, 10, style.getFirstColor().getRGB(), style.getSecondColor().getRGB()); DisplayUtils.drawShadow(posX, posY, padding * 16.5f + 1.5f, fontSize + padding * 2.5f + 1.5f, 14, ColorUtils.rgba(31,31,31,255), ColorUtils.rgba(31,31,31, 255)); if (FunctionRegistry.hud2.style.is("Градиентный фон")) { drawStyledRect(posX, posY, width, height, 4, 180); } else { drawStyledRect(posX, posY, width, height, 4, 255); } Scissor.push(); Scissor.setFromComponentCoordinates(posX, posY, width, height); Fonts.sfui.drawCenteredText(ms, name, posX + width / 2, posY + padding + 0.5f, fontSize); posY += fontSize + padding * 2; float maxWidth = Fonts.sfMedium.getWidth(name, fontSize) + padding * 2; float localHeight = fontSize + padding * 2; if (FunctionRegistry.hud2.style.is("Градиентный фон")) { DisplayUtils.drawRectHorizontalW(posX + 0.5f, posY, width - 1, 2.5f, 3, ColorUtils.rgba(0, 0, 0, (int) (255 * 0.25f))); } posY += 3f; for (Function f : Expensive.getInstance().getFunctionRegistry().getFunctions()) { f.getAnimation().update(); if (!(f.getAnimation().getValue() > 0) || f.getBind() == 0) continue; String nameText = f.getName(); float nameWidth = Fonts.sfMedium.getWidth(nameText, fontSize); String bindText = "<" + KeyStorage.getKey(f.getBind()) + ">"; float bindWidth = Fonts.sfMedium.getWidth(bindText, fontSize); float localWidth = nameWidth + bindWidth + padding * 3; Fonts.sfMedium.drawText(ms, nameText, posX + padding, posY + 0.5f, ColorUtils.rgba(210, 210, 210, (int) (255 * f.getAnimation().getValue())), fontSize); Fonts.sfMedium.drawText(ms, bindText, posX + width - padding - bindWidth, posY + 0.5f, ColorUtils.getColor(0), fontSize); if (localWidth > maxWidth) { maxWidth = localWidth; } //DisplayUtils.drawRectHorizontalW(posX + 0.5f, posY - 3f, width - 1, 2.5f, 3, ColorUtils.getColor(90)); posY += (float) ((fontSize + padding) * f.getAnimation().getValue()); localHeight += (float) ((fontSize + padding) * f.getAnimation().getValue()); } Scissor.unset(); Scissor.pop(); width = Math.max(maxWidth, 80); height = localHeight + 2.5f; dragging.setWidth(width); dragging.setHeight(height); if (mc.currentScreen instanceof ChatScreen){ DisplayUtils.drawImage(grab, posX + 20, posY - 17, 25,25, -1); } } private void drawStyledRect(float x, float y, float width, float height, float radius , int alpha) { Style style = Expensive.getInstance().getStyleManager().getCurrentStyle(); if (FunctionRegistry.hud2.style.is("Градиентный фон")) { DisplayUtils.drawRoundedRect(x - 0.5f, y - 0.5f, width + 1, height + 1, radius, style.getFirstColor().getRGB()); // outline } DisplayUtils.drawRoundedRect(x, y, width, height, radius, ColorUtils.rgba(31,31,31, alpha)); } } SS