diff options
author | jlew <jlew.blackout@gmail.com> | 2010-07-08 21:23:15 (GMT) |
---|---|---|
committer | jlew <jlew.blackout@gmail.com> | 2010-07-08 21:23:15 (GMT) |
commit | df467fbca7ed81ab51f34227495f9c67d2912f79 (patch) | |
tree | 65bc9e8c673c05c74065a1e0b5425aac0560e244 | |
parent | dd12a7a8093d74fb17a7d6dc70180ee976ffa59d (diff) |
Added always_draw flag
-rwxr-xr-x | MAFH2/MafhActivity.py | 2 | ||||
-rw-r--r-- | MAFH2/fortuneengine/GameEngine.py | 11 |
2 files changed, 10 insertions, 3 deletions
diff --git a/MAFH2/MafhActivity.py b/MAFH2/MafhActivity.py index 7aed828..f8cfee5 100755 --- a/MAFH2/MafhActivity.py +++ b/MAFH2/MafhActivity.py @@ -8,7 +8,7 @@ from Comic import Comic from Profile import Profile from MafhGameManager import MafhGameManager -ge = GameEngine(width=1200, height=900) +ge = GameEngine(width=1200, height=900, always_draw=True) def start_game(): ge.add_object('manager', MafhGameManager() ) diff --git a/MAFH2/fortuneengine/GameEngine.py b/MAFH2/fortuneengine/GameEngine.py index 0c8f52f..b5ce897 100644 --- a/MAFH2/fortuneengine/GameEngine.py +++ b/MAFH2/fortuneengine/GameEngine.py @@ -26,7 +26,7 @@ class GameEngine(object): """ instance = None - def __init__(self, width=1200, height=900): + def __init__(self, width=1200, height=900, always_draw=False): GameEngine.instance = self pygame.init() pygame.mouse.set_visible(False) @@ -39,7 +39,7 @@ class GameEngine(object): self.__showfps = False self.__dirty = True - self.__always_draw = True + self.__always_draw = always_draw self.__font = pygame.font.Font(None, 17) self.__run_event = False @@ -59,6 +59,13 @@ class GameEngine(object): # TODO Allow mouse motion on request pygame.event.set_blocked(pygame.MOUSEMOTION) + def set_dirty(self): + """ + Sets the dirty flag to force the engine to draw the next time + it enters the draw flag. + """ + self.__dirty = True + def start_event_timer(self, function_cb, time): """ Starts a timer that fires a user event into the queue every "time" |