示例#1
0
    def termination(self):
        _DEB('Termination(%s)' % self.__outtro)
        if self.__outtro is None:
            return

        if self.__outtro not in dir(transitions):
            _WRN('Ignore unrecognized transition: %s' % self.__intro)
            return
                 
        getattr(transitions, self.__outtro)(self.__frame,
                                            video.empty_image())
示例#2
0
 def __set_mode__(self, resolution):
     _DEB('Switch to: %s' % resolution)
     if (('x' not in resolution) and (',' not in resolution)):
         raise UIError('Resolution must be in WIDTHxHEIGTH or WIDTH,HEIGHT format!')
     try:
         if 'x' in resolution:
             x, y = resolution.split('x')
         else:
             x, y = resolution.split(',')
         resolution = (int(x), int(y))
     except:
         raise UIError('Resolution must be two integer values!')
     self.__video = video.Screen(resolution)
     self.__last_frame = video.empty_image()
示例#3
0
    def __init__(self, scene_config, adventure):
        self.__frame = pygame.Surface(video.Screen().get_size()).convert_alpha()
        self.__config = scene_config
        self.__adventure = adventure
        
        self.__background = self.__config.get('scenario', None)
        if self.__background is None:
            self.__background = video.empty_image()
        else:
            self.__background = video.load_image(self.__background)

        self.__intro = self.__config.get('intro', None)
        self.__outtro = self.__config.get('outtro', None)
        
        self.__script = self.__config.get('script', [])
        self.__script.reverse()
        self.__interpreter = script.Interpreter(self)

        self.__layout = None
示例#4
0
 def show_black(self, fade_audio=False):
     _DEB('Show black')
     self.__assert_video_enabled__()
     self.__show_image__(video.empty_image(), fade_audio)