comparison docs/specs/sprite.md @ 182:3107ce017c3a

Misc: switch back to SDL Qt Quick and QML was an exciting experiment but it's definitely not enough flexible and easy to use for game development. Using SDL2 will let us focusing on our own drawing functions without any kind of overhead. While here, start massive cleanup.
author David Demelier <markand@malikania.fr>
date Fri, 19 Oct 2018 20:18:19 +0200
parents
children
comparison
equal deleted inserted replaced
181:fbfc2555bda5 182:3107ce017c3a
1 # Sprite
2
3 A sprite is an object that splits an image into several cells. It is primarily
4 designed to combine multiple related images into one for better performance and
5 easier usage.
6
7 Sprites are mostly used as character design, some GUI elements, map tilesets
8 and other data that require lots of related images.
9
10 Sprites can be created natively in C++, Javascript or using the resource loader
11 with an appropriate JSON description.
12
13 ## JSON specification
14
15 ### Synopsis
16
17 ```json
18 {
19 "image": "image identifier",
20 "cell": [ 0, 0 ],
21 "margin": [ 0, 0 ],
22 "space": [ 0, 0 ],
23 "size": [ 50, 50 ]
24 }
25 ```
26
27 ### Properties
28
29 - **image**: unique identifier to an image,
30 - **cell**: size of sprite cells,
31 - **margin**: top/left and bottom/right margins (Optional: default none),
32 - **space**:
33 space between each cell horizontally/vertically (Optional: default none),
34 - **size**: override image size (Optional: default automatic).