aispritejs 0.1.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/LICENSE +21 -0
- package/README.md +211 -0
- package/README_ZHTW.md +209 -0
- package/dist/atlas/index.cjs +518 -0
- package/dist/atlas/index.cjs.map +1 -0
- package/dist/atlas/index.d.cts +52 -0
- package/dist/atlas/index.d.ts +52 -0
- package/dist/atlas/index.js +514 -0
- package/dist/atlas/index.js.map +1 -0
- package/dist/index.cjs +451 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +58 -0
- package/dist/index.d.ts +58 -0
- package/dist/index.js +445 -0
- package/dist/index.js.map +1 -0
- package/dist/pixi/index.cjs +520 -0
- package/dist/pixi/index.cjs.map +1 -0
- package/dist/pixi/index.d.cts +75 -0
- package/dist/pixi/index.d.ts +75 -0
- package/dist/pixi/index.js +517 -0
- package/dist/pixi/index.js.map +1 -0
- package/dist/types-DKMFvfx9.d.cts +251 -0
- package/dist/types-DKMFvfx9.d.ts +251 -0
- package/llms-full.txt +449 -0
- package/llms.txt +40 -0
- package/package.json +103 -0
- package/schemas/aispritejs-graph.schema.json +126 -0
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://github.com/yshengliao/aispritejs/schemas/aispritejs-graph.schema.json",
|
|
4
|
+
"title": "aispritejs input-driven sprite graph",
|
|
5
|
+
"description": "The aispritejs control graph augmenting a PixiJS-v8-native atlas. The universal `animations` / `frames` blocks plus the input-driven `inputs` / `states` / `transitions`. A foreign event-driven `states` block (the FSM `{ initial, definitions }` shape) is NOT described here and is ignored by the parser. The parser mirrors these constraints in code (fail-fast); this file is the canonical spec for editors and external validation.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": ["animations", "inputs", "states", "transitions"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"meta": {
|
|
10
|
+
"description": "PixiJS atlas metadata (image, size, scale). Ignored by aispritejs.",
|
|
11
|
+
"type": "object"
|
|
12
|
+
},
|
|
13
|
+
"animations": {
|
|
14
|
+
"description": "Animation name -> ordered list of frame keys (each non-empty).",
|
|
15
|
+
"type": "object",
|
|
16
|
+
"additionalProperties": {
|
|
17
|
+
"type": "array",
|
|
18
|
+
"items": { "type": "string" },
|
|
19
|
+
"minItems": 1
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"frames": {
|
|
23
|
+
"description": "Per-frame data keyed by frame key. Only `duration` (ms, > 0) is read by the core; other PixiJS fields are ignored.",
|
|
24
|
+
"type": "object",
|
|
25
|
+
"additionalProperties": {
|
|
26
|
+
"type": "object",
|
|
27
|
+
"properties": {
|
|
28
|
+
"duration": { "type": "number", "exclusiveMinimum": 0 }
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"inputs": {
|
|
33
|
+
"description": "Input declarations keyed by input name.",
|
|
34
|
+
"type": "object",
|
|
35
|
+
"additionalProperties": {
|
|
36
|
+
"oneOf": [
|
|
37
|
+
{
|
|
38
|
+
"type": "object",
|
|
39
|
+
"required": ["type"],
|
|
40
|
+
"properties": {
|
|
41
|
+
"type": { "const": "number" },
|
|
42
|
+
"default": { "type": "number" }
|
|
43
|
+
},
|
|
44
|
+
"additionalProperties": false
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"type": "object",
|
|
48
|
+
"required": ["type"],
|
|
49
|
+
"properties": {
|
|
50
|
+
"type": { "const": "boolean" },
|
|
51
|
+
"default": { "type": "boolean" }
|
|
52
|
+
},
|
|
53
|
+
"additionalProperties": false
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"type": "object",
|
|
57
|
+
"required": ["type"],
|
|
58
|
+
"properties": {
|
|
59
|
+
"type": { "const": "trigger" }
|
|
60
|
+
},
|
|
61
|
+
"additionalProperties": false
|
|
62
|
+
}
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"states": {
|
|
67
|
+
"description": "State declarations keyed by state name.",
|
|
68
|
+
"type": "object",
|
|
69
|
+
"minProperties": 1,
|
|
70
|
+
"additionalProperties": {
|
|
71
|
+
"type": "object",
|
|
72
|
+
"required": ["animation"],
|
|
73
|
+
"properties": {
|
|
74
|
+
"animation": { "type": "string" },
|
|
75
|
+
"loop": { "type": "boolean" },
|
|
76
|
+
"speed": { "type": "number", "exclusiveMinimum": 0 },
|
|
77
|
+
"onEnd": { "type": "string" }
|
|
78
|
+
},
|
|
79
|
+
"additionalProperties": false
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
"transitions": {
|
|
83
|
+
"description": "Transition edges, evaluated every update.",
|
|
84
|
+
"type": "array",
|
|
85
|
+
"items": {
|
|
86
|
+
"type": "object",
|
|
87
|
+
"required": ["from", "to"],
|
|
88
|
+
"properties": {
|
|
89
|
+
"from": {
|
|
90
|
+
"description": "Source state name, or \"*\" for an Any-State transition.",
|
|
91
|
+
"type": "string"
|
|
92
|
+
},
|
|
93
|
+
"to": { "type": "string" },
|
|
94
|
+
"priority": { "type": "integer" },
|
|
95
|
+
"when": {
|
|
96
|
+
"type": "array",
|
|
97
|
+
"items": {
|
|
98
|
+
"type": "object",
|
|
99
|
+
"required": ["input", "op"],
|
|
100
|
+
"properties": {
|
|
101
|
+
"input": { "type": "string" },
|
|
102
|
+
"op": {
|
|
103
|
+
"enum": ["Equals", "NotEquals", "GreaterThan", "LessThan", "Trigger"]
|
|
104
|
+
},
|
|
105
|
+
"value": {
|
|
106
|
+
"type": ["number", "boolean"]
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
"additionalProperties": false
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
"additionalProperties": false
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
"initial": {
|
|
117
|
+
"description": "Initial state name. Defaults to the first declared state.",
|
|
118
|
+
"type": "string"
|
|
119
|
+
},
|
|
120
|
+
"defaultFrameDuration": {
|
|
121
|
+
"description": "Fallback frame duration (ms, > 0) for frames without explicit timing. Defaults to 100.",
|
|
122
|
+
"type": "number",
|
|
123
|
+
"exclusiveMinimum": 0
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|