-
Автор темы
- #1
ss:

а также RenderUtil.Render2D.drawHudWindow:

Hud.java:
BetterText betterText = new BetterText(List.of("",
"evolate"
), 1500);
private void waterMark(final MatrixStack matrixStack) {
final float x = 6, y = 7;
String title = betterText.output;
String dubtitle = Manager.USER_PROFILE.getName() + " - " + mc.debugFPS + " fps" + " - " + HudUtil.calculatePing() + " ms";
final float titleHeight = 15;
final float titleWidths = Fonts.gilroyBold[15].getWidth(title) + 18;
float titleWidth = titleWidths;
final float addTitleWidth = Fonts.gilroy[15].getWidth(dubtitle) + 10;
final float fullWidth = titleWidth + addTitleWidth;
RenderUtil.Render2D.drawHudWindow(x, y, fullWidth, titleHeight);
RenderUtil.Render2D.drawImage(new ResourceLocation("evolate/images/star.png"), x + 6, y + 2f, 11, 11, ColorUtil.getColorStyle(0),ColorUtil.getColorStyle(0),ColorUtil.getColorStyle(0),ColorUtil.getColorStyle(0));
Fonts.gilroy[15].drawString(matrixStack, dubtitle, x + 5 + titleWidth, y + Fonts.gilroy[15].getFontHeight() / 2f + 1, ColorUtil.rgba(255, 255, 255, 255));
Fonts.gilroyBold[15].drawString(matrixStack, title, x + 10 + 8, y + Fonts.gilroy[15].getFontHeight() / 2f + 1, ColorUtil.getColorStyle(0));
}
RenderUtil.java:
public static void drawHudWindow(float x, float y, float w, float h) {
RenderUtil.Render2D.drawShadow(x + 1.5f, y, w, h, 9, ColorUtil.getColorStyle(180), ColorUtil.getColorStyle(0));
RenderUtil.Render2D.drawGradientRound(x + 3, y, w - 3, h / 2 + 3, 4, ColorUtil.getColorStyle(0), ColorUtil.getColorStyle(0), ColorUtil.getColorStyle(180), ColorUtil.getColorStyle(180));
RenderUtil.Render2D.drawRoundedRect(x + 3, y, w - 3, h, 4, ColorUtil.rgba(17, 17, 17, 255));
}