Mercurial > malikania
changeset 75:88d996df3eba
Docs: add sprite specifications
author | David Demelier <markand@malikania.fr> |
---|---|
date | Thu, 29 Dec 2016 11:34:40 +0100 |
parents | 78de82cc6bde |
children | 858621081b95 |
files | docs/specs/sprite.md |
diffstat | 1 files changed, 34 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/docs/specs/sprite.md Thu Dec 29 11:34:40 2016 +0100 @@ -0,0 +1,34 @@ +# Sprite + +A sprite is an object that splits an image into several cells. It is primarily +designed to combine multiple related images into one for better performance and +easier usage. + +Sprites are mostly used as character design, some GUI elements, map tilesets +and other data that require lots of related images. + +Sprites can be created natively in C++, Javascript or using the resource loader +with an appropriate JSON description. + +## JSON specification + +### Synopsis + +````json +{ + "image": "image identifier", + "cell": [ 0, 0 ], + "margin": [ 0, 0 ], + "space": [ 0, 0 ], + "size": [ 50, 50 ] +} +```` + +### Properties + + - **image**: unique identifier to an image, + - **cell**: size of sprite cells, + - **margin**: top/left and bottom/right margins (Optional: default none), + - **space**: + space between each cell horizontally/vertically (Optional: default none), + - **size**: override image size (Optional: default automatic). \ No newline at end of file