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 choosing layer.
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, selectedLibrary)
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.

Function Details

chooseFile(engine, masks=['*.*'], path='.', prompt='Choose a File')

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='Choose a Song', selectedSong=None, selectedLibrary=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
selectedLibrary -

Name of the library where to search for the songs or None for the default library

@returns a (library, song) pair

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='Loading...', 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="Play with the keys and press Escape when you're done.")

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

Generated by Epydoc 2.1 on Sat Apr 14 13:33:25 2007 http://epydoc.sf.net