Skip to content

Latest commit

 

History

History
62 lines (46 loc) · 1.55 KB

theme_tooltip.rst

File metadata and controls

62 lines (46 loc) · 1.55 KB

UITooltip Theming Parameters

The :class:`UIToolTip <pygame_gui.elements.UIToolTip>` theming block id is 'tool_tip'.

Misc

:class:`UITooltip <pygame_gui.elements.UITooltip>` accepts the following miscellaneous parameters in a 'misc' block:

  • "rect_width" - The width of the rectangle around the tool tip in pixels, including any shadows or borders. The height is determined dynamically.

Sub-elements

The :class:`UIToolTip <pygame_gui.elements.UIToolTip>` contains a :class:`UITextBox <pygame_gui.elements.UITextBox>` so you can use the block ID 'tool_tip.text_box' to start styling it.

There is more information on theming the text box at :ref:`theme-text-box`.

Example

Here is an example of a tool tip block in a JSON theme file, using parameters from the text box element.

 {
     "tool_tip":
     {
         "misc":
         {
            "rect_width": "170"
         }
     },
     "tool_tip.text_box":
     {
         "colours":
         {
             "dark_bg":"#505050",
             "normal_border": "#FFFFFF"
         },

         "misc":
         {
             "border_width": "2",
             "padding": "5,5"
         }
     }
 }