How to anchor Labels?

Started by FiveNights2161 on

Topic category: Help with MCreator software

Joined Jun 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to anchor Labels?

I'm trying to anchor a label to an ImageButton I've made, and I need the text to be able to stay within the button and properly size to the button.
I can't do what I want to do any other way, I just don't know how to modify the code for it in the way that I need.
The button will never move, but the text will change

	@Override
	protected void renderLabels(PoseStack poseStack, int mouseX, int mouseY) {
		this.font.draw(poseStack, Component.translatable("gui.stupid_dbc.action_menu.label_transformation"), 177, 139, -1);
		this.font.draw(poseStack,

				ShowSelectedTransformationProcedure.execute(entity), 202, 151, -12829636);
	}
Joined Feb 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
There are couple of API Mods…
Sat, 07/20/2024 - 17:50

There are couple of API Mods out there that simplified the creation of GUIs.

But that means also you need to code the GUI as well.