короче опять хотел сделать как в целке(noad) но не получилось ss: package im.prime.ui.display.impl; import com.mojang.blaze3d.matrix.MatrixStack; import com.mojang.blaze3d.platform.GlStateManager; import im.prime.Prime; import im.prime.events.EventDisplay; import im.prime.functions.api.Function; import im.prime.ui.display.ElementRenderer; import im.prime.utils.client.KeyStorage; import im.prime.utils.drag.Dragging; import im.prime.utils.math.MathUtil; import im.prime.utils.render.ColorUtils; import im.prime.utils.render.DisplayUtils; import im.prime.utils.render.font.Fonts; import im.prime.utils.text.GradientUtil; import net.minecraft.util.text.ITextComponent; public class KeyBindRenderer implements ElementRenderer { private final Dragging dragging; private float animation; private float width; private float height; public KeyBindRenderer(final Dragging dragging) { this.dragging = dragging; } @Override public void render(final EventDisplay eventDisplay) { final MatrixStack ms = eventDisplay.getMatrixStack(); final float posX = this.dragging.getX(); float posY = this.dragging.getY(); final float fontSize = 6.5f; final float padding = 5.0f; final ITextComponent name = GradientUtil.gradient("Keybinds"); float maxWidth = Fonts.sfbold.getWidth(name, fontSize) + padding * 2.0f; // Рисуем заголовок DisplayUtils.drawRoundedRect(posX, posY, this.animation, 25.0f, 4.0f, ColorUtils.rgba(21, 21, 21, 215)); Fonts.sfui.drawText(ms, "Keybinds", posX + 10, posY + padding + 1.5f, ColorUtils.rgb(255, 255, 255), 6.5f); posY += fontSize + padding * 2.0f + 5.0f; // Отступ после заголовка float localHeight = fontSize + padding * 2.0f; for (Function f : Prime.getInstance().getFunctionRegistry().getFunctions()) { f.getAnimation().update(); if (f.getAnimation().getValue() > 0.0 && f.getBind() != 0) { final String nameText = f.getName(); final float nameWidth = Fonts.sfbold.getWidth(nameText, fontSize); final String bindText = "[" + KeyStorage.getKey(f.getBind()) + "]"; final float bindWidth = Fonts.sfbold.getWidth(bindText, fontSize); final float localWidth = nameWidth + bindWidth + padding * 3.0f; DisplayUtils.drawRoundedRect(posX, posY, this.animation, 18.0f, 3.0f, ColorUtils.rgba(33, 33, 33, (int) (215.0 * f.getAnimation().getValue()))); Fonts.sfui.drawText(ms, nameText, posX + 4.0f, posY + 4.0f, ColorUtils.rgba(255, 255, 255, (int) (255.0 * f.getAnimation().getValue())), fontSize); Fonts.sfui.drawText(ms, bindText, posX + this.animation - 4.0f - bindWidth, posY + 4.0f, ColorUtils.rgba(255, 255, 255, (int) (255.0 * f.getAnimation().getValue())), fontSize); if (localWidth > maxWidth) { maxWidth = localWidth; } posY += (float) ((12.0f + padding) * f.getAnimation().getValue()); localHeight += (float) ((fontSize + padding) * f.getAnimation().getValue()); } } this.animation = MathUtil.lerp(this.animation, Math.max(maxWidth, 100.0f), 10.0f); this.height = localHeight + 5.0f; this.dragging.setWidth(this.animation); this.dragging.setHeight(this.height); } public static void sizeAnimation(final double width, final double height, final double scale) { GlStateManager.translated(width, height, 0.0); GlStateManager.scaled(scale, scale, scale); GlStateManager.translated(-width, -height, 0.0); } }