-
Notifications
You must be signed in to change notification settings - Fork 6
/
example.js
77 lines (71 loc) · 2.48 KB
/
example.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/*eslint-env node */
var pngQuant = require("imagemin-pngquant");
var jpegTran = require("imagemin-jpegtran");
module.exports = {
/**
* This defines a set of scales. For every scale a full set of
* spritesheets will be generated. The "resolution" field is passed
* through to PIXI.
**/
"scales": {
"web": {"scale": 0.5, "resolution": 1},
"web_retina": {"scale": 1, "resolution": 2}
},
/**
* Variations can be used for themes or languages. Sprites that are
* not part of one variation will be included in all of them.
**/
"variations": [ "EN", "DE"],
/**
* Different loading stages mean the game can started before all
* images have been loaded. Remaining images can be loaded while
* the user makes decisions or the game is going on.
**/
"loading_stages": [ "menu", "game" ],
group_default: {
max_width: 500, // default: 2048
max_height: 500, // default: 1024
oversized_warning: true, // default: false
padding: 1 // default: 1
},
/**
* Groups are units of images that fall into the same category in respect to
* - Variations: EN, DE, or (if not defined) both. If an array is provided
* the group will be added to all of the listed variations
* - JPEG: true/false (e.g. do we need an alpha channel?)
* - loading stage (see above)
* - quality
*
* All paths are relative to this file
**/
"groups": [
{
"id": "en_menu",
"variation": "EN",
"loading_stage": "menu",
"compressor": pngQuant(),
"sprites": ["example-sprites/menu/EN/*.png"]
},
{
"id": "de_menu",
"variation": "DE",
"loading_stage": "menu",
"compressor": pngQuant(),
"sprites": ["example-sprites/menu/DE/*.png"]
},
{ // No alpha channel needed, so we can use JPEG
"id": "menu_background",
"loading_stage": "menu",
"jpeg": true,
"quality": 90,
"compressor": jpegTran(),
"sprites": ["example-sprites/menu/menu_bg.png"]
},
{
"id": "game",
"loading_stage": "game",
"variation": ["DE", "EN"], // Equivalent to not having variation at all since the array includes all current variations
"sprites": ["example-sprites/game/**/*.png"]
}
]
};