How to change label text in a GUI using a procedure?

Started by GregSmith on

Topic category: Help with modding (Java Edition)

Last seen on 19:17, 26. Dec 2022
Joined Sep 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to change label text in a GUI using a procedure?

I have a GUI that displays the current date and time of day, but I don't know how to make the GUI update, which can be achieved by changing the text of the label, via a procedure.

However, I have zero experience on this type of thing so please explain it to me like I'm five.

Any help is appreciated. Thanks!

Last seen on 01:58, 4. Feb 2024
Joined Mar 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Your going to have to create…
Thu, 10/06/2022 - 01:29

Your going to have to create a variable for each number. Day, Hour, Minute. Assuming you already figured out how to make the procedure for counting the time, that means you already have variables right? You can use the Text in a GUI to display variables. when you click on the Text button, click the drop-down list and find your Day variable, then put it on your GUI wherever you want. Then do the same with your Hour and Minute. make sure you use the Integer variable so you don't get decimal points. 

If you haven't made variables yet. I suggest learning how to convert your timers into variables. Then its easy peasy.