Image

class pygame_menu.widgets.Image(image_path, image_id='', angle=0, scale=(1, 1), scale_smooth=True)[source]

Bases: pygame_menu.widgets.core.widget.Widget

Image widget.

Parameters:
  • image_path (str) – Path of the image
  • image_id (str) – Image ID
  • angle (int, float) – Angle of the image in degrees (clockwise)
  • scale (tuple, list) – Scale of the image (x,y), float or int
  • scale_smooth (bool) – Scale is smoothed
draw(surface)[source]

Draw the widget shape.

Parameters:surface (pygame.Surface) – Surface to draw
Returns:None
update(events)[source]

Update internal variable according to the given events list and fire the callbacks.

Parameters:events (list[pygame.event.Event]) – List of pygame events
Returns:True if updated
Return type:bool