modes Submodule


class procgame.modes.ScoreDisplay(game, priority, left_players_justify='right')

ScoreDisplay is a mode that provides a DMD layer containing a generic 1-to-4 player score display. To use ScoreDisplay simply instantiate it and add it to the mode queue. A low priority is recommended.

When the layer is asked for its next_frame() the DMD frame is built based on the player score and ball information contained in the GameController.

ScoreDisplay uses a number of fonts, the defaults of which are included in the shared DMD resources folder. If a font cannot be found then the score may not display properly in some states. Fonts are loaded using procgame.dmd.font_named(); see its documentation for dealing with fonts that cannot be found.

You can substitute your own fonts (of the appropriate size) by assigning the font attributes after initializing ScoreDisplay.


If non-None, update_layer() will call it with no parameters to get the credit string (usually FREE PLAY or CREDITS 1 or similar). If this method returns the empty string no text will be shown (and any ball count will be centered). If None, FREE PLAY will be shown.


Defaults to Font09x5.dmd.


Defaults to Font09x6.dmd.


Defaults to Font09x7.dmd.


Defaults to Font14x10.dmd.


Defaults to Font14x8.dmd.


Defaults to Font14x9.dmd.


Defaults to Font18x10.dmd.


Defaults to Font18x11.dmd.


Defaults to Font18x12.dmd.


Font used for the bottom status line text: 'BALL 1  FREE PLAY'. Defaults to Font07x5.dmd.

font_for_score(score, is_active_player)

Returns the font to be used for displaying the given numeric score value in a 2, 3, or 4-player game.


Returns the font to be used for displaying the given numeric score value in a single-player game.


Returns a string representation of the given score value. Override to customize the display of numeric score values.


Call to set the justification of the left-hand players’ scores in a multiplayer game. Valid values for left_players_justify are 'left' and 'right'.


Called by the layer to update the score layer for the present game state.

Table Of Contents

Previous topic

lamps Submodule

Next topic

sound Submodule

This Page