Search code examples
pythonjsonpygame-gui

why does my pygame_gui theme.json not recognise my 'normal_border' attribute?


I have a theme.json file for my pygame_gui application, however, I am unable to set the 'normal-border' attribute for a text box (it seems to not be read, unlike the other attributes in the file).

Things I've tried to resolve this:

  • "border-width": 0
  • Updating pygame-gui version to latest
  • Using a label instead of a text-box

Am I using the wrong attribute? The following documentation has been my reference so far: https://pygame-gui.readthedocs.io/en/latest/theme_reference/theme_text_box.html

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"
        }
    }
}

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! 🤦‍♀️