pygame-menu Logo
3.5.3

First steps

  • Creating menus
  • Adding widgets
  • Adding sounds
  • Creating themes
  • Gallery / Examples
    • Simple example
    • Game selector example
    • Multiple input example
    • Scroll menu example
    • Timer clock example
    • Other - Dynamic button append
    • Other - Dynamic widget update (OOP style)
    • Other - Image background
  • Migration Guide - v2 to v3

Advanced usage

  • Package organization
  • Create a widget
  • Create a selection effect

Widgets API

  • Button
  • ColorInput
  • Image
  • Label
  • MenuBar
  • ScrollBar
  • Selector
  • TextInput
  • VMargin

About pygame-menu

  • License
  • Contributors
pygame-menu
  • Docs »
  • Gallery / Examples
  • Edit on GitHub

Gallery / Examples¶

Several examples are provided with the pygame_menu library. To run the examples, simply execute these commands in a terminal:

$> python -m pygame_menu.examples.simple
$> python -m pygame_menu.examples.game_selector
$> python -m pygame_menu.examples.multi_input
$> python -m pygame_menu.examples.scroll_menu
$> python -m pygame_menu.examples.timer_clock

Other examples that show specific use cases of the menu are also provided:

$> python -m pygame_menu.examples.other.dynamic_button_append
$> python -m pygame_menu.examples.other.dynamic_widget_update
$> python -m pygame_menu.examples.other.image_background

Them can also be imported as follows:

from pygame_menu.examples.example import main

main()

Example sources can also be found in the Github repo.

Simple example¶

A basic button menu

Source: examples/simple.py

Game selector example¶

A simple game selector

Source: examples/game_selector.py

Multiple input example¶

This example features all widgets available on pygame-menu

Source: examples/multi_input.py

Scroll menu example¶

Since v3, menu supports scrolls Since v3, menu supports columns and scrolls

Source: examples/scroll_menu.py

Timer clock example¶

Timer clock

Source: examples/timer_clock.py

Other - Dynamic button append¶

Dynamic button append

Source: examples/other/dynamic_button_append.py

Other - Dynamic widget update (OOP style)¶

Dynamic widget update in object oriented programming style

Source: examples/other/dynamic_widget_update.py

Other - Image background¶

Image background

Source: examples/other/image_background.py


© Copyright 2017-2021, Pablo Pizarro R. @ppizarror Revision 7dfd8d8e.

Built with Sphinx using a theme provided by Read the Docs.
Read the Docs v: 3.5.3
Versions
master
latest
3.5.4
3.5.3
3.5.2
3.5.1
3.4.4
3.4.3
3.4.2
3.4.1
3.4.0
3.3.2
3.3.0
3.2.3
3.2.2
3.2.1
3.2.0
3.1.5
3.1.4
3.1.3
3.1.2
3.1.0
3.0.3
3.0.1
3.0.0
Downloads
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.