Widget selection effects
Core Class
- class pygame_menu.widgets.core.Selection(margin_left, margin_right, margin_top, margin_bottom)[source]
Widget selection effect class.
Note
All selection classes must be copyable.
- Parameters:
- get_height()[source]
Return the selection height as sum of top and bottom margins.
- Return type:
- Returns:
Height in px
- get_width()[source]
Return the selection width as sum of left and right margins.
- Return type:
- Returns:
Width in px
- set_background_color(color)[source]
Set the selection background color. It will replace the background color of the widget if selected.
Highlight Selection
- class pygame_menu.widgets.HighlightSelection(border_width=1, margin_x=16, margin_y=8)[source]
Bases:
Selection
Widget selection highlight class.
Note
Widget background color may not reach the entire selection area.
- Parameters:
Left Arrow Selection
- class pygame_menu.widgets.LeftArrowSelection(arrow_size=(10, 15), arrow_right_margin=5, arrow_vertical_offset=0, blink_ms=0)[source]
Bases:
ArrowSelection
Widget selection left arrow class. Creates an arrow to the left of the selected Menu item.
- Parameters:
arrow_size (
Tuple
[int
,int
]) – Size of arrow on x-axis and y-axis (width, height) in pxarrow_right_margin (
int
) – Distance from the arrow to the widget (px)arrow_vertical_offset (
int
) – Vertical offset of the arrow (px)blink_ms (
Union
[int
,float
]) – Milliseconds between each blink; if0
blinking is disabled
None Selection
- class pygame_menu.widgets.NoneSelection[source]
Bases:
SimpleSelection
No selection effect.
Right Arrow Selection
- class pygame_menu.widgets.RightArrowSelection(arrow_size=(10, 15), arrow_left_margin=3, arrow_vertical_offset=0, blink_ms=0)[source]
Bases:
ArrowSelection
Widget selection right arrow class. Creates an arrow to the right of the selected Menu item.
- Parameters:
arrow_size (
Tuple
[int
,int
]) – Size of arrow on x-axis and y-axis (width, height) in pxarrow_left_margin (
int
) – Distance from the arrow to the widget (px)arrow_vertical_offset (
int
) – Vertical offset of the arrow (px)blink_ms (
Union
[int
,float
]) – Milliseconds between each blink; if0
blinking is disabled