Ejemplo n.º 1
0
    def addFile(self, relPath, fullPath):
        """Adds the specific file to the sprite packer."""

        fileType = relPath.split('.')[-1]
        if fileType not in self.types:
            raise Exception('Unsupported image format: %s' % fileType)

        # Load image and grab required information
        img = ImgInfo(fullPath)
        width, height = img.getSize()
        checksum = img.getChecksum()

        self.files.append(SpriteFile(width, height, relPath, fullPath, checksum))

        Console.debug('- Found image "%s" (%dx%dpx)' % (relPath, width, height))
Ejemplo n.º 2
0
    def addFile(self, relPath, fullPath):
        """Adds the specific file to the sprite packer."""

        fileType = relPath.split('.')[-1]
        if fileType not in self.types:
            raise Exception('Unsupported image format: %s' % fileType)

        # Load image and grab required information
        img = ImgInfo(fullPath)
        width, height = img.getSize()
        checksum = img.getChecksum()

        self.files.append(
            SpriteFile(width, height, relPath, fullPath, checksum))

        Console.debug('- Found image "%s" (%dx%dpx)' %
                      (relPath, width, height))
Ejemplo n.º 3
0
    def addFile(self, relPath, fullPath):
        """Adds the specific file to the sprite packer."""

        fileType = relPath.split('.')[-1]
        if fileType not in self.types:
            raise Exception('Unsupported image format: %s' % fileType)

        # Load image and grab required information
        img = ImgInfo(fullPath)
        w, h = img.getSize()
        checksum = img.getChecksum()
        del img

        # TODO crop transparent "borders"
        # TODO allow for rotation

        self.files.append(SpriteFile(w, h, relPath, fullPath, checksum))

        Console.debug('- Found image "%s" (%dx%dpx)' % (relPath, w, h))
Ejemplo n.º 4
0
    def addFile(self, relPath, fullPath):
        """Adds the specific file to the sprite packer."""

        fileType = relPath.split(".")[-1]
        if fileType not in self.types:
            raise Exception("Unsupported image format: %s" % fileType)

        # Load image and grab required information
        img = ImgInfo(fullPath)
        w, h = img.getSize()
        checksum = img.getChecksum()
        del img

        # TODO crop transparent "borders"
        # TODO allow for rotation

        self.files.append(SpriteFile(w, h, relPath, fullPath, checksum))

        debug('- Found image "%s" (%dx%dpx)' % (relPath, w, h))