Widget Selection¶
Selection Effect¶
-
class
pygame_menu.widgets.core.
Selection
(margin_left, margin_right, margin_top, margin_bottom)[source]¶ Widget selection class.
Parameters: -
draw
(surface, widget)[source]¶ Draw the selection.
Parameters: - surface (
pygame.Surface
) – Surface to draw - widget (
pygame_menu.widgets.core.Widget
) – Widget object
Returns: None
- surface (
-
get_height
()[source]¶ Return height as sum of top and bottom margins.
Returns: Height in px Return type: int, float
-
get_margin
()[source]¶ Return top, left, bottom and right margins of the selection.
Returns: Tuple of (t,l,b,r) margins in px Return type: tuple, list
-
get_width
()[source]¶ Return width as sum of left and right margins.
Returns: Width in px Return type: int, float
-
inflate
(rect)[source]¶ Grow or shrink the rectangle size according to margins.
Parameters: rect ( pygame.Rect
) – rectangle
-
Highlight Selection Effect¶
-
class
pygame_menu.widgets.
HighlightSelection
(border_width=1, margin_x=16.0, margin_y=8.0)[source]¶ Bases:
pygame_menu.widgets.core.selection.Selection
Widget selection highlight class.
Parameters: -
draw
(surface, widget)[source]¶ Draw the selection.
Parameters: - surface (
pygame.Surface
) – Surface to draw - widget (
pygame_menu.widgets.core.Widget
) – Widget object
Returns: None
- surface (
-
Left Arrow Selection Effect¶
-
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: -
draw
(surface, widget)[source]¶ Draw the selection.
Parameters: - surface (
pygame.Surface
) – Surface to draw - widget (
pygame_menu.widgets.core.Widget
) – Widget object
Returns: None
- surface (
-
None Selection Effect¶
-
class
pygame_menu.widgets.
NoneSelection
[source]¶ Bases:
pygame_menu.widgets.core.selection.Selection
No selection effect.
-
draw
(surface, widget)[source]¶ Draw the selection.
Parameters: - surface (
pygame.Surface
) – Surface to draw - widget (
pygame_menu.widgets.core.Widget
) – Widget object
Returns: None
- surface (
-
Right Arrow Selection Effect¶
-
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: -
draw
(surface, widget)[source]¶ Draw the selection.
Parameters: - surface (
pygame.Surface
) – Surface to draw - widget (
pygame_menu.widgets.core.Widget
) – Widget object
Returns: None
- surface (
-