@ludic-labs/assembly 0.0.0-stage → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +78 -0
- package/LICENSE +2 -0
- package/README.md +50 -2
- package/dist/bake.d.ts +80 -0
- package/dist/bake.js +214 -0
- package/dist/browser.d.ts +89 -0
- package/dist/browser.js +534 -0
- package/dist/compat.d.ts +17 -0
- package/dist/compat.js +153 -0
- package/dist/compiler.d.ts +18 -0
- package/dist/compiler.js +1264 -0
- package/dist/diagnostics.d.ts +5 -0
- package/dist/diagnostics.js +8 -0
- package/dist/export.d.ts +54 -0
- package/dist/export.js +272 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +3 -0
- package/dist/legacy.d.ts +36 -0
- package/dist/legacy.js +180 -0
- package/dist/math.d.ts +16 -0
- package/dist/math.js +62 -0
- package/dist/mesh.d.ts +11 -0
- package/dist/mesh.js +153 -0
- package/dist/motion.d.ts +63 -0
- package/dist/motion.js +1476 -0
- package/dist/pixel.d.ts +268 -0
- package/dist/pixel.js +942 -0
- package/dist/required.d.ts +2 -0
- package/dist/required.js +6 -0
- package/dist/shapes.d.ts +71 -0
- package/dist/shapes.js +396 -0
- package/dist/sprite-brief.d.ts +5 -0
- package/dist/sprite-brief.js +47 -0
- package/dist/sprite-compiler.d.ts +62 -0
- package/dist/sprite-compiler.js +1745 -0
- package/dist/sprite-decompile.d.ts +68 -0
- package/dist/sprite-decompile.js +786 -0
- package/dist/sprite-format.d.ts +4 -0
- package/dist/sprite-format.js +155 -0
- package/dist/sprite-guide.d.ts +40 -0
- package/dist/sprite-guide.js +330 -0
- package/dist/sprite-scene.d.ts +277 -0
- package/dist/sprite-scene.js +664 -0
- package/dist/sprite-types.d.ts +110 -0
- package/dist/sprite-types.js +1 -0
- package/dist/sprite.d.ts +8 -0
- package/dist/sprite.js +8 -0
- package/dist/svg/schema.d.ts +71 -0
- package/dist/svg/schema.js +217 -0
- package/dist/svg/types.d.ts +148 -0
- package/dist/svg/types.js +1 -0
- package/dist/svg.d.ts +26 -0
- package/dist/svg.js +539 -0
- package/dist/text.d.ts +12 -0
- package/dist/text.js +75 -0
- package/dist/types.d.ts +478 -0
- package/dist/types.js +1 -0
- package/docs/svg/README.md +150 -0
- package/docs/svg/specification.md +108 -0
- package/examples/svg/arcane-shield.json +261 -0
- package/examples/svg/aurora-ribbon.json +158 -0
- package/examples/svg/bouncing-ember.json +76 -0
- package/examples/svg/ember-fountain.json +224 -0
- package/examples/svg/lantern-keeper.json +1159 -0
- package/examples/svg/night-workshop.json +1120 -0
- package/examples/svg/waygate-platform.json +64 -0
- package/examples/svg/waygate-spark.json +92 -0
- package/examples/svg/waygate-wisp.json +105 -0
- package/examples/svg/waygate.json +485 -0
- package/package.json +132 -4
- package/schemas/asset-assembly-0.1.schema.json +354 -0
- package/schemas/asset-assembly-0.2.schema.json +429 -0
- package/schemas/asset-assembly-0.3.schema.json +572 -0
- package/schemas/motion-set-0.1.schema.json +178 -0
- package/schemas/pixel-sprite-0.1.schema.json +892 -0
- package/schemas/pixel-sprite-scene-0.1.schema.json +149 -0
- package/schemas/svg-asset-0.1.schema.json +1157 -0
- package/tools/svg-asset.mjs +106 -0
|
@@ -0,0 +1,354 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://libraries.ludic-assembly.victorqueiroz.dev/schema.json",
|
|
4
|
+
"title": "Ludic Assembly 0.1",
|
|
5
|
+
"description": "Structural schema. Use validateAsset for reference, graph, bounds and geometry validation.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"schema": {
|
|
9
|
+
"const": "asset-assembly/0.1"
|
|
10
|
+
},
|
|
11
|
+
"units": {
|
|
12
|
+
"enum": ["meters", "tiles"]
|
|
13
|
+
},
|
|
14
|
+
"parameters": {
|
|
15
|
+
"type": "object",
|
|
16
|
+
"minProperties": 0,
|
|
17
|
+
"maxProperties": 256,
|
|
18
|
+
"propertyNames": {
|
|
19
|
+
"pattern": "^[A-Za-z][A-Za-z0-9_-]{0,79}$"
|
|
20
|
+
},
|
|
21
|
+
"additionalProperties": {
|
|
22
|
+
"type": "number"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"materials": {
|
|
26
|
+
"type": "object",
|
|
27
|
+
"minProperties": 1,
|
|
28
|
+
"maxProperties": 256,
|
|
29
|
+
"propertyNames": {
|
|
30
|
+
"pattern": "^[A-Za-z][A-Za-z0-9_-]{0,79}$"
|
|
31
|
+
},
|
|
32
|
+
"additionalProperties": {
|
|
33
|
+
"type": "object",
|
|
34
|
+
"properties": {
|
|
35
|
+
"color": {
|
|
36
|
+
"type": "string",
|
|
37
|
+
"pattern": "^#[0-9a-fA-F]{6}$"
|
|
38
|
+
},
|
|
39
|
+
"tintable": {
|
|
40
|
+
"type": "boolean"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"required": ["color"],
|
|
44
|
+
"additionalProperties": false
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
"groups": {
|
|
48
|
+
"type": "object",
|
|
49
|
+
"minProperties": 0,
|
|
50
|
+
"maxProperties": 256,
|
|
51
|
+
"propertyNames": {
|
|
52
|
+
"pattern": "^[A-Za-z][A-Za-z0-9_-]{0,79}$"
|
|
53
|
+
},
|
|
54
|
+
"additionalProperties": {
|
|
55
|
+
"type": "object",
|
|
56
|
+
"properties": {
|
|
57
|
+
"parent": {
|
|
58
|
+
"type": "string"
|
|
59
|
+
},
|
|
60
|
+
"position": {
|
|
61
|
+
"$ref": "#/$defs/point"
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
"required": ["position"],
|
|
65
|
+
"additionalProperties": false
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"parts": {
|
|
69
|
+
"type": "object",
|
|
70
|
+
"minProperties": 1,
|
|
71
|
+
"maxProperties": 256,
|
|
72
|
+
"propertyNames": {
|
|
73
|
+
"pattern": "^[A-Za-z][A-Za-z0-9_-]{0,79}$"
|
|
74
|
+
},
|
|
75
|
+
"additionalProperties": {
|
|
76
|
+
"type": "object",
|
|
77
|
+
"properties": {
|
|
78
|
+
"shape": {
|
|
79
|
+
"oneOf": [
|
|
80
|
+
{
|
|
81
|
+
"type": "object",
|
|
82
|
+
"properties": {
|
|
83
|
+
"type": {
|
|
84
|
+
"const": "box"
|
|
85
|
+
},
|
|
86
|
+
"size": {
|
|
87
|
+
"type": "object",
|
|
88
|
+
"properties": {
|
|
89
|
+
"width": {
|
|
90
|
+
"$ref": "#/$defs/scalar"
|
|
91
|
+
},
|
|
92
|
+
"height": {
|
|
93
|
+
"$ref": "#/$defs/scalar"
|
|
94
|
+
},
|
|
95
|
+
"depth": {
|
|
96
|
+
"$ref": "#/$defs/scalar"
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
"required": ["width", "height", "depth"],
|
|
100
|
+
"additionalProperties": false
|
|
101
|
+
},
|
|
102
|
+
"bevel": {
|
|
103
|
+
"$ref": "#/$defs/scalar"
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
"required": ["type", "size"],
|
|
107
|
+
"additionalProperties": false
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"type": "object",
|
|
111
|
+
"properties": {
|
|
112
|
+
"type": {
|
|
113
|
+
"const": "cylinder"
|
|
114
|
+
},
|
|
115
|
+
"radius": {
|
|
116
|
+
"$ref": "#/$defs/scalar"
|
|
117
|
+
},
|
|
118
|
+
"height": {
|
|
119
|
+
"$ref": "#/$defs/scalar"
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
"required": ["type", "radius", "height"],
|
|
123
|
+
"additionalProperties": false
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"type": "object",
|
|
127
|
+
"properties": {
|
|
128
|
+
"type": {
|
|
129
|
+
"const": "funnel"
|
|
130
|
+
},
|
|
131
|
+
"bottomRadius": {
|
|
132
|
+
"$ref": "#/$defs/scalar"
|
|
133
|
+
},
|
|
134
|
+
"topRadius": {
|
|
135
|
+
"$ref": "#/$defs/scalar"
|
|
136
|
+
},
|
|
137
|
+
"height": {
|
|
138
|
+
"$ref": "#/$defs/scalar"
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
"required": ["type", "bottomRadius", "topRadius", "height"],
|
|
142
|
+
"additionalProperties": false
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"type": "object",
|
|
146
|
+
"properties": {
|
|
147
|
+
"type": {
|
|
148
|
+
"const": "beam"
|
|
149
|
+
},
|
|
150
|
+
"from": {
|
|
151
|
+
"$ref": "#/$defs/point"
|
|
152
|
+
},
|
|
153
|
+
"to": {
|
|
154
|
+
"$ref": "#/$defs/point"
|
|
155
|
+
},
|
|
156
|
+
"width": {
|
|
157
|
+
"$ref": "#/$defs/scalar"
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
"required": ["type", "from", "to", "width"],
|
|
161
|
+
"additionalProperties": false
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
"type": "object",
|
|
165
|
+
"properties": {
|
|
166
|
+
"type": {
|
|
167
|
+
"const": "tube"
|
|
168
|
+
},
|
|
169
|
+
"from": {
|
|
170
|
+
"$ref": "#/$defs/point"
|
|
171
|
+
},
|
|
172
|
+
"to": {
|
|
173
|
+
"$ref": "#/$defs/point"
|
|
174
|
+
},
|
|
175
|
+
"radius": {
|
|
176
|
+
"$ref": "#/$defs/scalar"
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
"required": ["type", "from", "to", "radius"],
|
|
180
|
+
"additionalProperties": false
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
"type": "object",
|
|
184
|
+
"properties": {
|
|
185
|
+
"type": {
|
|
186
|
+
"const": "coil"
|
|
187
|
+
},
|
|
188
|
+
"radius": {
|
|
189
|
+
"$ref": "#/$defs/scalar"
|
|
190
|
+
},
|
|
191
|
+
"thickness": {
|
|
192
|
+
"$ref": "#/$defs/scalar"
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
"required": ["type", "radius", "thickness"],
|
|
196
|
+
"additionalProperties": false
|
|
197
|
+
}
|
|
198
|
+
]
|
|
199
|
+
},
|
|
200
|
+
"material": {
|
|
201
|
+
"type": "string"
|
|
202
|
+
},
|
|
203
|
+
"placement": {
|
|
204
|
+
"oneOf": [
|
|
205
|
+
{
|
|
206
|
+
"type": "object",
|
|
207
|
+
"properties": {
|
|
208
|
+
"type": {
|
|
209
|
+
"const": "absolute"
|
|
210
|
+
},
|
|
211
|
+
"selfAnchor": {
|
|
212
|
+
"type": "string"
|
|
213
|
+
},
|
|
214
|
+
"position": {
|
|
215
|
+
"$ref": "#/$defs/point"
|
|
216
|
+
}
|
|
217
|
+
},
|
|
218
|
+
"required": ["type", "selfAnchor", "position"],
|
|
219
|
+
"additionalProperties": false
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
"type": "object",
|
|
223
|
+
"properties": {
|
|
224
|
+
"type": {
|
|
225
|
+
"const": "attach"
|
|
226
|
+
},
|
|
227
|
+
"selfAnchor": {
|
|
228
|
+
"type": "string"
|
|
229
|
+
},
|
|
230
|
+
"target": {
|
|
231
|
+
"type": "object",
|
|
232
|
+
"properties": {
|
|
233
|
+
"part": {
|
|
234
|
+
"type": "string"
|
|
235
|
+
},
|
|
236
|
+
"anchor": {
|
|
237
|
+
"type": "string"
|
|
238
|
+
}
|
|
239
|
+
},
|
|
240
|
+
"required": ["part", "anchor"],
|
|
241
|
+
"additionalProperties": false
|
|
242
|
+
},
|
|
243
|
+
"offset": {
|
|
244
|
+
"$ref": "#/$defs/point"
|
|
245
|
+
}
|
|
246
|
+
},
|
|
247
|
+
"required": ["type", "selfAnchor", "target"],
|
|
248
|
+
"additionalProperties": false
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
"type": "object",
|
|
252
|
+
"properties": {
|
|
253
|
+
"type": {
|
|
254
|
+
"const": "repeat"
|
|
255
|
+
},
|
|
256
|
+
"pattern": {
|
|
257
|
+
"const": "corners"
|
|
258
|
+
},
|
|
259
|
+
"selfAnchor": {
|
|
260
|
+
"type": "string"
|
|
261
|
+
},
|
|
262
|
+
"target": {
|
|
263
|
+
"type": "object",
|
|
264
|
+
"properties": {
|
|
265
|
+
"part": {
|
|
266
|
+
"type": "string"
|
|
267
|
+
},
|
|
268
|
+
"face": {
|
|
269
|
+
"enum": ["top", "bottom"]
|
|
270
|
+
}
|
|
271
|
+
},
|
|
272
|
+
"required": ["part", "face"],
|
|
273
|
+
"additionalProperties": false
|
|
274
|
+
},
|
|
275
|
+
"edgeInset": {
|
|
276
|
+
"type": "object",
|
|
277
|
+
"properties": {
|
|
278
|
+
"x": {
|
|
279
|
+
"$ref": "#/$defs/scalar"
|
|
280
|
+
},
|
|
281
|
+
"z": {
|
|
282
|
+
"$ref": "#/$defs/scalar"
|
|
283
|
+
}
|
|
284
|
+
},
|
|
285
|
+
"required": ["x", "z"],
|
|
286
|
+
"additionalProperties": false
|
|
287
|
+
}
|
|
288
|
+
},
|
|
289
|
+
"required": ["type", "pattern", "selfAnchor", "target", "edgeInset"],
|
|
290
|
+
"additionalProperties": false
|
|
291
|
+
}
|
|
292
|
+
]
|
|
293
|
+
},
|
|
294
|
+
"parent": {
|
|
295
|
+
"type": "string"
|
|
296
|
+
},
|
|
297
|
+
"anchors": {
|
|
298
|
+
"type": "object",
|
|
299
|
+
"minProperties": 0,
|
|
300
|
+
"maxProperties": 256,
|
|
301
|
+
"propertyNames": {
|
|
302
|
+
"pattern": "^[A-Za-z][A-Za-z0-9_-]{0,79}$"
|
|
303
|
+
},
|
|
304
|
+
"additionalProperties": {
|
|
305
|
+
"$ref": "#/$defs/point"
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
},
|
|
309
|
+
"required": ["shape", "material", "placement"],
|
|
310
|
+
"additionalProperties": false
|
|
311
|
+
}
|
|
312
|
+
},
|
|
313
|
+
"groundPivot": {
|
|
314
|
+
"$ref": "#/$defs/point"
|
|
315
|
+
}
|
|
316
|
+
},
|
|
317
|
+
"required": ["schema", "units", "materials", "parts"],
|
|
318
|
+
"additionalProperties": false,
|
|
319
|
+
"$defs": {
|
|
320
|
+
"scalar": {
|
|
321
|
+
"oneOf": [
|
|
322
|
+
{
|
|
323
|
+
"type": "number"
|
|
324
|
+
},
|
|
325
|
+
{
|
|
326
|
+
"type": "object",
|
|
327
|
+
"properties": {
|
|
328
|
+
"parameter": {
|
|
329
|
+
"type": "string"
|
|
330
|
+
}
|
|
331
|
+
},
|
|
332
|
+
"required": ["parameter"],
|
|
333
|
+
"additionalProperties": false
|
|
334
|
+
}
|
|
335
|
+
]
|
|
336
|
+
},
|
|
337
|
+
"point": {
|
|
338
|
+
"type": "object",
|
|
339
|
+
"properties": {
|
|
340
|
+
"x": {
|
|
341
|
+
"$ref": "#/$defs/scalar"
|
|
342
|
+
},
|
|
343
|
+
"y": {
|
|
344
|
+
"$ref": "#/$defs/scalar"
|
|
345
|
+
},
|
|
346
|
+
"z": {
|
|
347
|
+
"$ref": "#/$defs/scalar"
|
|
348
|
+
}
|
|
349
|
+
},
|
|
350
|
+
"required": ["x", "y", "z"],
|
|
351
|
+
"additionalProperties": false
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
}
|