pythonjsonpygame-gui

pygame_gui textbox border styling


Been trying to use pygame_gui within a program I'm currently developing, however, been having some trouble with the text box element styling.

I've taken a look at their example repos and docs and made a theme.json accordingly. At the moment, all I want to do is style this one text box to be transparent with no border (or a transparent one) - the problem is, every attribute apart from normal-border gets styled as I specify. It just seems to not pick up on it whatsoever.

I've tried with "border-width": 0 and still had no luck. I have also tried updating my version to the repo's latest (0.6.5) with no luck, and have also previously tried using a label instead but the none of the methods seem to work, and it would just write on top of previous text instead, even after implementing the same code as in examples.

Not sure if I'm using the wrong attribute but have tried several, and this is what it states within the docs for the theming of this element.

Here is my theme file:

{
    "#points_label":
    {
        "colours":
        {
            "dark_bg": "#ffffff00",
            "normal_text": "#000000",
            "normal_border": "#ffffff00"
        },
        "misc": {
            "border_width": 0,
            "shadow_width": 0,
            "text_horiz_alignment": "center"
        }
    }
}

Trying to sus if there's something I'm missing, or if this is just a broken feature.


Solution

  • Turns out I was missing quotation marks for the "border_width" and "shadow_width" values - I guess I missed it when no errors were thrown! 🤦‍♀️