Пример #1
0
    def __loadBottom(self, filename, check_w=1, check_h=1, color='white'):
        cs_type = CSI.TYPE_ID[self.cs.type]
        imagedir = None
        d = os.path.join('images', 'cards', 'bottoms')
        try:
            imagedir = self.d.findDir(cs_type, d)
        except Exception:
            pass
        if (not USE_PIL and TOOLKIT != 'kivy') or imagedir is None:
            # load image
            img = self.__loadCard(filename+self.cs.ext, check_w, check_h)
            return img

        # create image
        d = os.path.join('images', 'cards', 'bottoms', cs_type)
        try:
            fn = self.d.findImage(filename, d)
        except Exception:
            fn = None
        img = createBottom(self._card[0], color, fn)
        return img
Пример #2
0
 def __loadBottom(self, filename, check_w=1, check_h=1, color="white"):
     cs_type = CSI.TYPE_ID[self.cs.type]
     imagedir = None
     d = os.path.join("images", "cards", "bottoms")
     try:
         imagedir = self.d.findDir(cs_type, d)
     except:
         pass
     if not USE_PIL or imagedir is None:
         # load image
         img = self.__loadCard(filename + self.cs.ext, check_w, check_h)
         if USE_PIL:
             # we have no bottom images (data/images/cards/bottoms/<cs_type>)
             img = img.resize(self._xfactor, self._yfactor)
         return img
     # create image
     d = os.path.join("images", "cards", "bottoms", cs_type)
     try:
         fn = self.d.findImage(filename, d)
     except:
         fn = None
     img = createBottom(self._card[0], color, fn)
     return img
Пример #3
0
 def __loadBottom(self, filename, check_w=1, check_h=1, color='white'):
     cs_type = CSI.TYPE_ID[self.cs.type]
     imagedir = None
     d = os.path.join('images', 'cards', 'bottoms')
     try:
         imagedir = self.d.findDir(cs_type, d)
     except:
         pass
     if not USE_PIL or imagedir is None:
         # load image
         img = self.__loadCard(filename + self.cs.ext, check_w, check_h)
         if USE_PIL:
             # we have no bottom images (data/images/cards/bottoms/<cs_type>)
             img = img.resize(self._xfactor, self._yfactor)
         return img
     # create image
     d = os.path.join('images', 'cards', 'bottoms', cs_type)
     try:
         fn = self.d.findImage(filename, d)
     except:
         fn = None
     img = createBottom(self._card[0], color, fn)
     return img
Пример #4
0
 def __loadBottom(self, filename, check_w=1, check_h=1, color='white'):
     cs_type = CSI.TYPE_ID[self.cs.type]
     imagedir = None
     d = os.path.join('images', 'cards', 'bottoms')
     try:
         imagedir = self.d.findDir(cs_type, d)
     except Exception:
         pass
     if (not USE_PIL and TOOLKIT is not 'kivy') or imagedir is None:
         # load image
         img = self.__loadCard(filename+self.cs.ext, check_w, check_h)
         if USE_PIL and img is not None:
             # we have no bottom images
             # (data/images/cards/bottoms/<cs_type>)
             img = img.resize(self._xfactor, self._yfactor)
         return img
     # create image
     d = os.path.join('images', 'cards', 'bottoms', cs_type)
     try:
         fn = self.d.findImage(filename, d)
     except Exception:
         fn = None
     img = createBottom(self._card[0], color, fn)
     return img