Dialogs

Module Dialogs |
[show private | hide private]
[frames | no frames]

## Module Dialogs

A bunch of dialog functions for interacting with the user.

Classes
`BpmEstimator` | Beats per minute value estimation layer.
`FileChooser` | File choosinglayer.
`GetKey` | Key choosing layer.
`GetText` | Text input layer.
`ItemChooser` | Item menu layer.
`KeyTester` | Keyboard configuration testing layer.
`LoadingScreen` | Loading screen layer.
`MessageScreen` | Message screen layer.
`SongChooser` | Song choosing layer.

Function Summary
| ``chooseFile`(engine, masks, path, prompt)` Ask the user to select a file.
| ``chooseItem`(engine, items, prompt, selected)` Ask the user to one item from a list.
| ``chooseSong`(engine, prompt, selectedSong)` Ask the user to select a song.
| ``estimateBpm`(engine, song, prompt)` Ask the user to estimate the beats per minute value of a song.
| ``fadeScreen`(v)` Fade the screen to a dark color to make whatever is on top easier to read.
| ``getKey`(engine, prompt, key)` Ask the user to choose a key.
| ``getText`(engine, prompt, text)` Get a string of text from the user.
| ``showLoadingScreen`(engine, condition, text, allowCancel)` Show a loading screen until a condition is met.
| ``showMessage`(engine, text)` Show a message to the user.
| ``testKeys`(engine, prompt)` Have the user test the current keyboard configuration.
| ``wrapText`(font, pos, text, rightMargin, scale, visibility)` Wrap a piece of text inside given margins.
| ``_runDialog`(engine, dialog)` Run a dialog in a sub event loop until it is finished.

Function Details

### chooseFile(engine, masks=['*.*'], path='.', prompt=u'Choisissez un Fichier') Ask the user to select a file. Parameters: `engine` - Game engine `masks` - List of glob masks for files that are acceptable `path` - Initial path `prompt` - Prompt shown to the user

### chooseItem(engine, items, prompt, selected=None) Ask the user to one item from a list. Parameters: `engine` - Game engine `items` - List of items `prompt` - Prompt shown to the user `selected` - Item selected by default

### chooseSong(engine, prompt=u'Choisissez une Chanson', selectedSong=None) Ask the user to select a song. Parameters: `engine` - Game engine `prompt` - Prompt shown to the user `selectedSong` - Name of song to select initially

### estimateBpm(engine, song, prompt) Ask the user to estimate the beats per minute value of a song. Parameters: `engine` - Game engine `song` - Song instance `prompt` - Prompt shown to the user

### fadeScreen(v) Fade the screen to a dark color to make whatever is on top easier to read. Parameters: `v` - Visibility factor [0..1], 0 is fully visible

### getKey(engine, prompt, key=None) Ask the user to choose a key. Parameters: `engine` - Game engine `prompt` - Prompt shown to the user `key` - Default key

### getText(engine, prompt, text='') Get a string of text from the user. Parameters: `engine` - Game engine `prompt` - Prompt shown to the user `text` - Default text

### showLoadingScreen(engine, condition, text=u'Chargement...', allowCancel=False) Show a loading screen until a condition is met. Parameters: `engine` - Game engine `condition` - A function that will be polled until it returns a true value `text` - Text shown to the user `allowCancel` - Can the loading be canceled (type=bool) Returns: True if the condition was met, Fales if the loading was canceled.

### showMessage(engine, text) Show a message to the user. Parameters: `engine` - Game engine `text` - Message text

### testKeys(engine, prompt=u'Jouez avec les touches et appuyez sur Echap quand vous ...) Have the user test the current keyboard configuration. Parameters: `engine` - Game engine `prompt` - Prompt shown to the user

### wrapText(font, pos, text, rightMargin=0.90000000000000002, scale=0.002, visibility=0.0) Wrap a piece of text inside given margins. Parameters: `pos` - (x, y) tuple, x defines the left margin `text` - Text to wrap `rightMargin` - Right margin `scale` - Text scale `visibility` - Visibility factor [0..1], 0 is fully visible

### _runDialog(engine, dialog) Run a dialog in a sub event loop until it is finished.

Generated by Epydoc 2.1 on Thu Nov 23 23:40:42 2006 | http://epydoc.sf.net