class shell.Shell(RootWidget)

The Shell class is an abstract class to use as a base for the outer shell of a game. It provides facilities for switching between a number of screens, such as menus, pages of instructions or the game itself. Screens are normally subclasses of the Screen widget.


Initializes the Shell with the given surface as its root surface (normally this will be the PyGame screen surface).


Read-only. The widget being displayed as the current screen. Use the show_screen() method to change this.


Hides the previous screen, if any, and shows the given widget as the new screen. The widget is displayed centered within the shell.

The leave_screen() method of the previous screen is called before hiding it, and the enter_screen() method of the new screen is called after showing it.
Calls the timer_event() method of the current screen, if any, and returns its result.

Abstract Methods

If you are using the TextScreen widget, you will need to implement this method. It should switch to whichever screen you're using for the game's main menu. It will be called when a TextScreen is being displayed and the user presses the Back button on that screen.