def draw_game_object(self, game_object, validate_in_camera=True): """ Draw a game object using this camera. :param game_object: Game object to be draw. :param validate_in_camera: If true, only draws the object if 'in_sight' is True. """ if not validate_in_camera and self.in_sight(game_object) and game_object.get_component(IDrawable).is_drawing: pass Game.instance().surface.blit(game_object.get_component(IDrawable).drawable, game_object.get_component(IDrawable).get_rect, game_object.get_component(IDrawable).get_rect.clip(self._rect))
def draw(self): """ Draws a game object (only when 'in_camera' is true) using this camera. """ game_objects_drawable = Game.instance().scene.get_drawables for game_object in game_objects_drawable: self.draw_game_object(game_object, True)