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
Highlight Selection¶
- class pygame_menu.widgets.HighlightSelection(border_width=1, margin_x=16, margin_y=8)[source]¶
Bases:
pygame_menu.widgets.core.selection.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:
pygame_menu.widgets.selection.arrow_selection.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:
pygame_menu.widgets.selection.simple.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:
pygame_menu.widgets.selection.arrow_selection.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
Simple Selection¶
- class pygame_menu.widgets.SimpleSelection[source]¶
Bases:
pygame_menu.widgets.core.selection.Selection
This selection effect only tells widget to apply selection color to font if selected.