- 163
- 7
- 24
Как можно изменить шрифт на кнопке в GUI?
Java:
public static class RenderButton extends Button {
FontRenderer font = Minecraft.getInstance().font;
public RenderButton(int p_i232255_1_, int p_i232255_2_, int p_i232255_3_, int p_i232255_4_, ITextComponent p_i232255_5_, IPressable p_i232255_6_) {
super(p_i232255_1_, p_i232255_2_, p_i232255_3_, p_i232255_4_, p_i232255_5_, p_i232255_6_);
}
@Override
public void renderButton(MatrixStack matrixStack, int p_230431_2_, int p_230431_3_, float p_230431_4_) {
float textScale = 0.7f;
matrixStack.pushPose();
matrixStack.scale(textScale, textScale, 1.0f);
font.draw(matrixStack, new TranslationTextComponent("button.render.effect"), 50, 50, 0x40cfff);
matrixStack.popPose();
super.renderButton(matrixStack, p_230431_2_, p_230431_3_, p_230431_4_);
}
}