Help with GUI

Started by abelcaron on

Topic category: Help with modding (Java Edition)

Last seen on 20:14, 19. Aug 2020
Joined May 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Help with GUI

Hello,

I want to do a custom GUI and when I run my mouse over an item or a button that show me  some informations ( text ).

Is it possible ?

Last seen on 04:35, 17. Jan 2021
Joined Sep 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
renderTooltip( String text, …
Thu, 06/04/2020 - 13:14
renderTooltip(
String text, // Text to display
int xPos, // X Position on Screen
int yPos // Y Position on Screen
);

That is what you are looking for. Does MCreator not have this?

Last seen on 20:14, 19. Aug 2020
Joined May 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I don't know but i am a…
Thu, 06/04/2020 - 13:52

I don't know but i am a beginner in code so i don't understand that ^^

I will search

 

Last seen on 04:35, 17. Jan 2021
Joined Sep 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
If you are a beginner I do…
Thu, 06/04/2020 - 14:01

If you are a beginner I do recommend doing research and learning. To guide you in the right direction, this snippet should go in the render function where the last two parameters are provided.

 

When working on a "big" GUI. I recommend making a method in the GUI class that contains your tooltips. This saves time and keeps your GUI organized.

Last seen on 20:14, 19. Aug 2020
Joined May 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
okay thank you i will learn…
Thu, 06/04/2020 - 14:03

okay thank you i will learn more 

 

Last seen on 14:00, 14. Nov 2023
Joined Jun 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
tbrosky, where do I put the…
Thu, 06/04/2020 - 14:44

tbrosky, where do I put the code you gave in the GUI's code?

Last seen on 04:35, 17. Jan 2021
Joined Sep 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
renderTooltip( String text, …
Thu, 06/04/2020 - 14:50
renderTooltip(
String text, // Text to display
int xPos, // X Position on Screen
int yPos // Y Position on Screen
);

This? This snippet would go in the render function in the GUI class. If you need more help, please post code--preferably in a pastebin/git.

Last seen on 14:00, 14. Nov 2023
Joined Jun 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
tbroski Any idea? Please…
Thu, 06/04/2020 - 22:27

tbroski Any idea? Please help!

 

Last seen on 04:35, 17. Jan 2021
Joined Sep 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
@Override public…
Thu, 06/04/2020 - 23:12
  @Override
        public void render(int mouseX, int mouseY, float partialTicks) {
            this.renderBackground();
            super.render(mouseX, mouseY, partialTicks);
            this.renderHoveredToolTip(mouseX, mouseY);
        }

Line 270

Last seen on 14:00, 14. Nov 2023
Joined Jun 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I did this and it doesn't…
Fri, 06/05/2020 - 09:35

I did this and it doesn't work... help tbroski plzz
Img

Last seen on 14:00, 14. Nov 2023
Joined Jun 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
tbroski I did it it works! …
Fri, 06/05/2020 - 11:38

tbroski I did it it works!
code

Buuut there is one problem

game

First, the tooltip is not where I want it to be (above the biggest green bottle) and then I want the tooltip to be seen only if the player has its mouse ON the green bottle.

Last seen on 20:14, 19. Aug 2020
Joined May 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
ehh you are a genious i…
Fri, 06/05/2020 - 12:12

ehh you are a genious i tried so many times and i did'nt arrive to make something right

Last seen on 20:14, 19. Aug 2020
Joined May 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
you did it with mcreator ?  …
Fri, 06/05/2020 - 12:13

you did it with mcreator ?

 

 

Last seen on 14:00, 14. Nov 2023
Joined Jun 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Please don't post more than…
Fri, 06/05/2020 - 12:14

Please don't post more than 1 post at the time because it spams.
I'm figuring out how to make the tooltip appear when our mouse is on a location.
Yes I did it with MCreator (because we are kinda in a MCreator forum lmao)