Jump to content

[1.7.2] Question: Tooltips for liquid level in gui


Skytanic

Recommended Posts

I have a quick question. How would one go about drawing a tooltip that displays the current level of liquid in a tank when hovered over in the gui. Basically a tooltip that will spit out my int value for petroleum whenever i'm hovered over a certain section of the gui.

 

I've searched around a bit but haven't found anything that I can get working. Any tips are helpful! thanks

Link to comment
Share on other sites

You can use

func_146283_a

in the Gui class to draw the default tooltips. The List should contain the lines you want to draw, parameters 2 and 3 and the x & y coordinates. Then in your drawScreen method just check if the mouse coordinates (you get the as parameters) are in the area you want, and if so call the tooltip method.

 

Oh one more thing, So I have it here

 

08445d5166.jpg

 

How would I make the petroleum text a bit darker, and also put a line break after it so the values are below it, since obviously /r/n isn't working.

 

Also interesting... Just realized all my slots and stuff are not there anymore. Something to do with adding drawScreen has caused my container class to not work correctly I guess?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.