Jump to content

[1.7.10]Custom GUI Button/Button Icon


webik150

Recommended Posts

Hey! I finally managed to create and understand a GUI. Currently I'm trying to create buttons for it. I would really like to have custom ones. That means button with custom background/icon or an clickable item. Currently I'm thinking of achieving the first one by rendering another texture over the button and changing it on mousePressed, however that isn't doable with the item if it has transparency. Is there some easier way to do it?

Link to comment
Share on other sites

Check vanilla's GuiButton and how it works. Basicly it checks if your mouse cursor is over the button boundaries and changes hover texture if so. You can just extend GuiButton or FML's GuiButtonExt (which is by the way little bit better than Vanilla one) and bind your own texture.

Link to comment
Share on other sites

The texture is the button. So, just render your texture as the button. No over or under is needed here. If mouse is in button boundary, then render the textured rectangle with your highlighted texture, otherwise use a non-hightlighted texture for the button.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

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