X-Git-Url: https://git.ctpug.org.za/?a=blobdiff_plain;f=tabakrolletjie%2Fscenes%2Fbase.py;h=320ff8006b312abe49f96fe7af021472f9e82605;hb=b6f24c356e8efcebb68e224329e0bc135ace6e16;hp=71f7d6ccc3d2615700e4be37c1d4a4e008d6be76;hpb=274f1d6fb3fcb077aa89aba219b0e34c6fa71ed9;p=tabakrolletjie.git diff --git a/tabakrolletjie/scenes/base.py b/tabakrolletjie/scenes/base.py index 71f7d6c..320ff80 100644 --- a/tabakrolletjie/scenes/base.py +++ b/tabakrolletjie/scenes/base.py @@ -1,7 +1,26 @@ """ Base scene class. """ +from pygame.sprite import RenderUpdates +from ..cursor import Cursor + class BaseScene(object): + def __init__(self): + self._cursor = Cursor() + self._cursor_group = RenderUpdates() + + def _set_cursor(self, name): + self._cursor.activate(name, self._cursor_group) + + def _unset_cursor(self): + self._cursor.deactivate(self._cursor_group) + + def _draw_cursor(self, surface): + """Draw the cursor. Should be called at the end of the render + method by scenes that need it.""" + self._cursor_group.update() + self._cursor_group.draw(surface) + def enter(self, gamestate): """ Enter the scene. """