017ec86232ca9c0def57bf4b4e0ac3a4cbf73827
[nit.git] / contrib / inkscape_tools / README.md
1 # SVG to PNG and Nit
2
3 This tool is used in combination with Inkscape to simplify assets creation for _mnit_ apps. It uses Inkscape to extract a PNG file from a SVG file. It will also create a Nit source file to create _mnit_ images for each objects with an id beginning by 0.
4
5 # Features
6
7 * Creates a sinlge PNG file per SVG source file
8 * Creates subimages for objects with an id beginning by 0.
9 * If the id ends with 0 to 9, will instead create an array of subimages.
10
11 # Usage
12
13 1. Create a new Inkscape document.
14 2. Create objects and set their ids to begin with 0
15 3. Save the document (ex: to `drawing.svg`) the name of the file is important
16 4. Execute `bin/svg_to_png_and_nit drawing.svg`
17 5. From your code, import the generated source file (at  src/drawing.nit`)
18 6. Use the class `DrawingImages` and its attributes.
19
20 # Examples
21
22 The minimal test in  tests/app/  shows the basic usage of this tool.
23
24 The Dino example `../../../../examples/mnit_dino` also uses this tool and is a more complete and practical example.
25
26 # Authors
27
28 Alexis Laferrière <alexis.laf@xymus.net>