1 """ Base scene class. """
3 from pygame.sprite import RenderUpdates
4 from ..cursor import Cursor
7 class BaseScene(object):
9 self._cursor = Cursor()
10 self._cursor_group = RenderUpdates()
12 def _set_cursor(self, name, transform=None):
13 self._cursor.activate(name, self._cursor_group, transform=transform)
15 def _unset_cursor(self):
16 self._cursor.deactivate(self._cursor_group)
18 def _draw_cursor(self, surface):
19 """Draw the cursor. Should be called at the end of the render
20 method by scenes that need it."""
21 self._cursor_group.update()
22 self._cursor_group.draw(surface)
24 def enter(self, gamestate):
25 """ Enter the scene. """
27 def exit(self, gamestate):
28 """ Leave the scene. """
30 def event(self, ev, gamestate):
31 """ Handle an event. """
33 def render(self, screen, gamestate):
34 """ Render the scene. """
36 def tick(self, gamestate):
37 """ Update the world based on time """