Search code examples
pygameuilabeltransparency

Pygame-GUI module: How to create a transparent UILabel


Id like to create a transparent background for pygame_gui.elements.UILabel so the content can be displayed over an image without a coloured background. Im using a json theme which is best practice for pygame_gui, the key word being "dark_bg" to enter a hexadecimal value. Ive tried "None" and " " both dont produce the desired results and there doesnt appear to be another key word that allows for transparency. Any ideas?

Regards.


Solution

  • In pygame_gui, if you want a fully transparent thing, you enter the color as "#00000000"

    Each two digits represent R, G, B, and A (alpha, transparency) successively.