rexmenu.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:rexmenu 作者: robmcmullen 项目源码 文件源码
def __init__(self, font, rom="", emulator="advmame", title="", imgpath="", find_image=None, max_size=-1, extra_paths=[]):
        if imgpath:
            filename, _ = os.path.splitext(os.path.basename(imgpath))
            if "_" in filename:
                rom, title = filename.split("_", 1)
            else:
                rom = title = filename
        elif rom:
            imgpath = find_image(rom, emulator, extra_paths)
        if title:
            self.title = title
        else:
            self.title = rom
        self.cmdline = shlex.split(emulator)
        self.cmdline.append(rom)
        try:
            self.image = pygame.image.load(imgpath).convert(24)
            self.rect = self.image.get_rect()
            if max_size > 0:
                self.rescale(max_size)
        except pygame.error:
            self.image = None
        self.label = font.render(self.title, 1, grey)
        self.label_size = font.size(self.title)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号