jasy.asset package

Submodules

jasy.asset.ImageInfo module

class jasy.asset.ImageInfo.GifFile(filename)[source]

Bases: jasy.asset.ImageInfo.ImgFile

Class for parsing GIF files.

size()[source]
type()[source]
verify()[source]
class jasy.asset.ImageInfo.ImgFile(filename)[source]

Bases: object

Abstract base class for all image types.

close()[source]
getChecksum()[source]
size()[source]
type()[source]
verify()[source]
class jasy.asset.ImageInfo.ImgInfo(filename)[source]

Bases: object

classes = [<class 'jasy.asset.ImageInfo.PngFile'>, <class 'jasy.asset.ImageInfo.GifFile'>, <class 'jasy.asset.ImageInfo.JpegFile'>]
getChecksum()[source]
getInfo()[source]

Returns (width, height, “type”) of the image.

getSize()[source]

Returns the image sizes of png, gif and jpeg files as.

(width, height) tuple

class jasy.asset.ImageInfo.JpegFile(filename)[source]

Bases: jasy.asset.ImageInfo.ImgFile

size()[source]
type()[source]
verify()[source]
class jasy.asset.ImageInfo.PngFile(filename)[source]

Bases: jasy.asset.ImageInfo.ImgFile

Class for parsing PNG files.

size()[source]
type()[source]
verify()[source]

jasy.asset.Manager module

class jasy.asset.Manager.AssetManager(profile)[source]

Bases: object

addProject(project)[source]
copyAssets()[source]

Copies assets from their source folder to the configured destination folder.

Does apply file name transformations during copying when requested.

exportToJson(items=None)[source]

Exports asset data for usage at the client side.

Utilizes JavaScript class jasy.Asset to inject data into the client at runtime.

getAnimationColumns(fileId)[source]
getAnimationFrames(fileId)[source]
getAnimationRows(fileId)[source]
getAssetHeight(fileId)[source]

Returns the width (image height) of the given item.

getAssetUrl(fileId)[source]

Returns the asset URL for the given item relative to the current working path.

getAssetWidth(fileId)[source]

Returns the width (image width) of the given item.

getSpriteHeight(fileId)[source]

Returns the height of the sprite sheet which contains the given single image.

getSpriteId(fileId)[source]

Returns the sprite asset which contains the image with the given ID.

getSpriteLeft(fileId)[source]

Returns the left position of the image on the sprite sheet.

getSpriteTop(fileId)[source]

Returns the top position of the image on the sprite sheet.

getSpriteUrl(fileId)[source]

Returns the url of the sprite sheet which contains the given single image.

getSpriteWidth(fileId)[source]

Returns the width of the sprite sheet which contains the given single image.

processAnimations()[source]

Processes jasyanimation files to merge animation data into asset registry.

processSprites()[source]

Processes jasysprite files to merge sprite data into asset registry.

jasy.asset.SpritePacker module

class jasy.asset.SpritePacker.PackerScore(sheets, external)[source]

Bases: object

data()[source]
class jasy.asset.SpritePacker.SpritePacker(base, types='png', width=1024, height=1024)[source]

Bases: object

Packs single images into sprite images automatically.

addDir(directory, recursive=False)[source]

Adds all images within a directory to the sprite packer.

addFile(relPath, fullPath)[source]

Adds the specific file to the sprite packer.

clear()[source]

Removes all generated sprite files found in the base directory.

generate(path='', debug=False)[source]

Generate sheets/variants.

pack(width=1024, height=1024, sort=None, silent=False)[source]

Packs all sprites within the pack into sheets of the given size.

packBest()[source]

Pack blocks into a sprite sheet by trying multiple settings.

packDir(path='', recursive=True, debug=False)[source]

Pack images inside a dir into sprite sheets.

setDataFormat(format='yaml')[source]

Sets format for metadata output - for format support take a look at jasy.core.Config.

Module contents