pygame-menu Logo
3.5.2

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 a14a88fb.

Built with Sphinx using a theme provided by Read the Docs.
Read the Docs v: 3.5.2
Versions
master
latest
3.5.2
3.5.1
Downloads
html
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.