Package pygext :: Package gl :: Package director :: Module scene :: Class Scene
[frames | no frames]

Type Scene

object --+
         |
        Scene


Method Summary
  __init__(self, *arg, **kw)
  __getitem__(self, layername)
  __iter__(self)
  add(self, layername, entity)
add(layername, entity) -> Entity
  add_all(self, layername, entitylist)
add_all(layername, entitylist) -> None
  clear_collnodes(self)
  clear_nonstatic(self)
clear_nonstatic() -> None
  del_layer(self, name)
del_layer(layername) -> None
  draw(self)
draw() -> None
  enter(self, *arg, **kw)
This method is called when the scene is activated.
  exit(self)
This method is called when the scene ends.
  get_layer(self, name)
get_layer(name) -> Layer
  handle_events(self, events)
handle_events(events) -> None
  handle_quit(self, event)
Default handler for pygame.QUIT event is to stop the Director
  init(self)
This method is called when the scene is created.
  make_entity(self)
make_entity -> Entity
  new_layer(self, name, depth, camera)
new_layer(name, depth=None) -> Layer
  new_stabile(self, name, depth, camera)
Create a new stable layer
  new_static(self, name, depth, camera)
new_static(name, depth=None) -> layer
  pick(self, x, y, layer)
Pick the foremost entity from the given screen coordinates.
  realtick(self)
  remove(self, entity)
remove(entity) -> None
  remove_all(self, entitylist)
remove_all(entitylist) -> None
  set_collision_handler(self, group1, group2, handler)
  set_depth(self, layername, depth)
set_depth(layername, depth) -> None
  set_state(self, new_state)
  tick(self)
This method is called once per frame.

Class Variable Summary
NoneType collengine = None                                                                  

Method Details

add(self, layername, entity)

add(layername, entity) -> Entity

Add an entity to the given layer.

add_all(self, layername, entitylist)

add_all(layername, entitylist) -> None

Add all entities from a list to the given layer.

clear_nonstatic(self)

clear_nonstatic() -> None

Clear all non-static layers.

del_layer(self, name)

del_layer(layername) -> None

Delete the specified layer.

draw(self)

draw() -> None

Draw all layers in z-order to the screen.

enter(self, *arg, **kw)

This method is called when the scene is activated. Override in a subclass.

exit(self)

This method is called when the scene ends. Override in a subclass.

get_layer(self, name)

get_layer(name) -> Layer

Get a specific layer using its name.

handle_events(self, events)

handle_events(events) -> None

Delegates pygame events to specific event handling methods. This method is usually called by the Director and should not be used directly.

handle_quit(self, event)

Default handler for pygame.QUIT event is to stop the Director

init(self)

This method is called when the scene is created. Override in a subclass.

make_entity(self)

make_entity -> Entity

Create an entity from the whole scene that can be used to draw (a static version) of the scene on another scene.

new_layer(self, name, depth=None, camera=False)

new_layer(name, depth=None) -> Layer

Create a new entity layer to the scene. If depth is omitted, the layer will be created on top of all previously created layers.

new_stabile(self, name, depth=None, camera=False)

Create a new stable layer

On a stable layer, entities retain their original z-order, but adding and removing entities is slower. Use when your entities need to overlap.

new_static(self, name, depth=None, camera=False)

new_static(name, depth=None) -> layer

Create a new static layer to the scene. Static layers offer much better performance for a high number of entities, but once placed on this layer, no change in the entities is reflected on the screen. Good for non-moving background elements.

pick(self, x, y, layer=None)

Pick the foremost entity from the given screen coordinates. Layer name can be given as an optional parameter to restrict the search to a single layer.

remove(self, entity)

remove(entity) -> None

Remove an entity from the scene.

remove_all(self, entitylist)

remove_all(entitylist) -> None

Remove all listed entities from the scene.

set_depth(self, layername, depth)

set_depth(layername, depth) -> None

Set a new depth for the given layer.

tick(self)

This method is called once per frame. Overide in a subclass

You can also prefix the tick-method with the state name to make
state-spesific tick functions. E.g.

def state_main_tick(self):
    pass
def state_waitkey_tick(self):
    pass
...

Class Variable Details

collengine

Type:
NoneType
Value:
None                                                                  

Generated by Epydoc 2.1 on Mon Jun 12 18:21:21 2006 http://epydoc.sf.net