示例#1
0
    def generateAtlas(self, atlasPath, atlasSize, **kwargs):
        #5. pack all bitmap in cache into atlas
        prefix = 'output'  #TODO: use real output name
        kwargs['spacing'] = 1

        imageInfos = self.generateImagesInfo()

        atlasGen = AtlasGenerator(prefix, atlasSize, **kwargs)
        atlas = atlasGen.generateOneAtlas(imageInfos, [])

        atlas.name = atlasPath
        atlasGen.paintAtlas(atlas, atlas.name)
        atlas.id = 0

        return atlas
示例#2
0
	def generateAtlas( self, path, prefix, size ):
		infos = []
		for deck in self.deckItems:
			infos += deck.getAtlasImgInfos()

		option = {
			'spacing' : 1
		}
		atlasGen = AtlasGenerator( prefix, size, **option )
		atlas = atlasGen.generateOneAtlas( infos, [] )

		atlas.name = prefix + '.png'
		atlas.nameNormal = prefix + '_n' + '.png'
		atlasGen.paintAtlas( atlas, path+atlas.name,       format = 'PNG' )
		atlasGen.paintAtlas( atlas, path+atlas.nameNormal, format = 'PNG', imgSet = 'normal' )
		atlas.id = 0

		return atlas
示例#3
0
    def generateAtlas(self, path, prefix, size):
        infos = []
        for deck in self.decks:
            infos += deck.getAtlasImgInfos()
        kwargs = {}
        kwargs['spacing'] = 1
        atlasGen = AtlasGenerator(prefix, size, **kwargs)
        atlas = atlasGen.generateOneAtlas(infos, [])

        atlas.name = prefix + '.png'
        atlas.nameNormal = prefix + '_n' + '.png'
        atlasGen.paintAtlas(atlas, path + atlas.name, format='PNG')
        atlasGen.paintAtlas(atlas,
                            path + atlas.nameNormal,
                            format='PNG',
                            imgSet='normal')
        atlas.id = 0

        return atlas
示例#4
0
    def generateAtlas(self, atlasPath, atlasSize):
        infos = []
        for theme in self.themes:
            for group in theme.groups:
                for tile in group.tiles:
                    (w, h) = tile.getSize()
                    img = TileImg('', w, h, (0, 0, w, h))
                    img.src = tile
                    tile.imgInfo = img
                    infos.append(img)
        kwargs = {}
        prefix = 'output'  #TODO: use real output name
        kwargs['spacing'] = 1
        atlasGen = AtlasGenerator(prefix, atlasSize, **kwargs)
        atlas = atlasGen.generateOneAtlas(infos, [])

        atlas.name = atlasPath
        atlasGen.paintAtlas(atlas, atlas.name)
        atlas.id = 0

        return atlas