| Trees | Indices | Toggle frames |
|---|
layer.Layer --+
|
Menu
Abstract base class for menu layers.
Normal usage is:
- create a subclass
- override __init__ to set all style attributes, and then call create_menu()
- Finally you shall add the menu to an Scene or another Layer
| __init__(self, title='') | |
|
create_menu(self,
items,
selected_effect=None,
unselected_effect=None,
activated_effect=None)
Creates the menu
|
|
| draw(self) | |
| on_text(self, text) | |
| on_key_press(self, symbol, modifiers) | |
| on_mouse_release(self, x, y, buttons, modifiers) | |
| on_mouse_motion(self, x, y, dx, dy) |
is_event_handler = True
Receives pyglet events
|
|
select_sound = None
|
|
activate_sound = None
|
Creates the menu
The order of the list important since the first one will be shown first.
Example:
l = [] l.append( MenuItem('Options', self.on_new_game ) ) l.append( MenuItem('Quit', self.on_quit ) ) self.create_menu( l, zoom_in(), zoom_out() )
| Trees | Indices | Toggle frames |
|---|
| Generated by Epydoc 3.0beta1 on Sat Sep 6 13:21:11 2008 | http://epydoc.sourceforge.net |