Modification of a Text Label's Font size (GUI and Overlay)

Started by Comrade Cookovsky on

Topic category: Troubleshooting, bugs, and solutions

Last seen on 19:04, 9. Aug 2024
Joined Feb 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Modification of a Text Label's Font size (GUI and Overlay)
Thu, 07/25/2024 - 02:41 (edited)

So I have recently been getting quite into making GUIs for blocks/inventories and I've come across quite an annoying problem in the process. The GUI editor does not seem to have any way of modifying a Text Label's font size. This is very annoying, as you'd imagine, as the text is often too large or too small and because the only other solutions I could think of were pre-making an image with text (but this would not work in my case for most to every Text Label in the mod as they are to be modified by a procedure for displaying values and such) and attempting to figure out Javascript to mess with the code (Last resort).

In relation to a possible programming fix, the only thing I was able to locate in the (GUI name)Screen.java file was a pair of lines that went like this- (Mind you I do come from the Lua programming language so I know my way around things a bit, but not entirely here in java)

 

    protected void renderLabels(GuiGraphics guiGraphics, int mouseX, int mouseY) { 
        guiGraphics.drawString(this.font, Component.translatable("gui.(My mod's modid).guianvil.label_sseinputs"), 127, 13, -12829636, false); 
    } 

//My assumption is that this has to do with the Text Label

https://imgur.com/Nld4ZaX - An image which demonstrates what I wish to do, in comparison with what I have.
 

So, to the knowledgeable out there, is there any way possible, by the GUI editor or extensive programming, that I could simply change the font size of the desired Text Label?

 

Edited by Comrade Cookovsky on Thu, 07/25/2024 - 02:41