Jump to content

Recommended Posts

Posted

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?

Posted

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.

Posted

Ok so I've got a problem. How can I render my texture OVER the button? Whatever I tried rendered the texture below the button so I couldn't see it.

Posted

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.

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.