예제 #1
0
파일: MSpriteProject.py 프로젝트: tommo/gii
    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, 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
예제 #3
0
파일: psd2tileset.py 프로젝트: pixpil/gii
	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
예제 #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
예제 #5
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
예제 #6
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
예제 #7
0
파일: psd2deckpack.py 프로젝트: pixpil/gii
	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
예제 #8
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