incanto 0.8.0 → 0.10.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/editor/index.html CHANGED
@@ -5,9 +5,9 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <title>Incanto Scene Editor</title>
7
7
  <link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><rect width='16' height='16' rx='3' fill='%236ee7dc'/><text x='8' y='12' text-anchor='middle' font-size='11' font-family='monospace' fill='%230e1018'>i</text></svg>" />
8
- <script type="module" crossorigin src="./assets/index-CVhnNkb3.js"></script>
8
+ <script type="module" crossorigin src="./assets/index-Dp_cYQx1.js"></script>
9
9
  <link rel="modulepreload" crossorigin href="./assets/GameServer-C56iOUgF.js">
10
- <link rel="stylesheet" crossorigin href="./assets/index-DF3tMeKJ.css">
10
+ <link rel="stylesheet" crossorigin href="./assets/index-D8QvwvOm.css">
11
11
  </head>
12
12
  <body>
13
13
  <header id="topbar">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "incanto",
3
- "version": "0.8.0",
3
+ "version": "0.10.0",
4
4
  "description": "Vibe-coding-first web game engine SDK — JSON-driven scenes on three.js",
5
5
  "keywords": [
6
6
  "game-engine",
@@ -190,6 +190,9 @@
190
190
  {
191
191
  "$ref": "#/$defs/Billboard3D"
192
192
  },
193
+ {
194
+ "$ref": "#/$defs/BoneAttachment3D"
195
+ },
193
196
  {
194
197
  "$ref": "#/$defs/Camera2D"
195
198
  },
@@ -1090,6 +1093,109 @@
1090
1093
  },
1091
1094
  "required": ["name", "type"]
1092
1095
  },
1096
+ "BoneAttachment3D": {
1097
+ "type": "object",
1098
+ "properties": {
1099
+ "name": {
1100
+ "type": "string"
1101
+ },
1102
+ "uid": {
1103
+ "type": "string"
1104
+ },
1105
+ "type": {
1106
+ "const": "BoneAttachment3D"
1107
+ },
1108
+ "groups": {
1109
+ "type": "array",
1110
+ "items": {
1111
+ "type": "string"
1112
+ }
1113
+ },
1114
+ "tags": {
1115
+ "type": "object"
1116
+ },
1117
+ "props": {
1118
+ "type": "object",
1119
+ "properties": {
1120
+ "position": {
1121
+ "type": "array",
1122
+ "items": {
1123
+ "type": "number"
1124
+ },
1125
+ "minItems": 3,
1126
+ "maxItems": 3,
1127
+ "default": [0, 0, 0]
1128
+ },
1129
+ "rotation": {
1130
+ "type": "array",
1131
+ "items": {
1132
+ "type": "number"
1133
+ },
1134
+ "minItems": 3,
1135
+ "maxItems": 3,
1136
+ "default": [0, 0, 0]
1137
+ },
1138
+ "static": {
1139
+ "type": "boolean",
1140
+ "default": false
1141
+ },
1142
+ "scale": {
1143
+ "type": "array",
1144
+ "items": {
1145
+ "type": "number"
1146
+ },
1147
+ "minItems": 3,
1148
+ "maxItems": 3,
1149
+ "default": [1, 1, 1]
1150
+ },
1151
+ "visible": {
1152
+ "type": "boolean",
1153
+ "default": true
1154
+ },
1155
+ "renderOrder": {
1156
+ "type": "number",
1157
+ "default": 0
1158
+ },
1159
+ "orderGroup": {
1160
+ "type": "string",
1161
+ "enum": ["background", "terrain", "default", "characters", "effects", "overlay"],
1162
+ "default": "default"
1163
+ },
1164
+ "target": {
1165
+ "type": "string",
1166
+ "default": ""
1167
+ },
1168
+ "bone": {
1169
+ "type": "string",
1170
+ "default": ""
1171
+ }
1172
+ },
1173
+ "additionalProperties": false
1174
+ },
1175
+ "script": {
1176
+ "type": "object",
1177
+ "properties": {
1178
+ "name": {
1179
+ "type": "string"
1180
+ },
1181
+ "props": {
1182
+ "type": "object"
1183
+ }
1184
+ },
1185
+ "required": ["name"]
1186
+ },
1187
+ "network": {
1188
+ "type": "object"
1189
+ },
1190
+ "children": {
1191
+ "type": "array",
1192
+ "items": {
1193
+ "$ref": "#/$defs/node"
1194
+ }
1195
+ }
1196
+ },
1197
+ "required": ["name", "type"]
1198
+ },
1093
1199
  "Camera2D": {
1094
1200
  "type": "object",
1095
1201
  "properties": {
@@ -117,6 +117,32 @@ itself never rotates. The skin MOUNTS at 180° (facing away from the default
117
117
  camera, original parity) and then faces wherever it moves; `skinYawOffset`
118
118
  adds a correction for models whose native forward is not +z.
119
119
 
120
+ ## Mounting things on bones (`BoneAttachment3D`)
121
+
122
+ A sword in the hand, a hat on the head, sparks on a wingtip — parent them to a
123
+ `BoneAttachment3D` and they ride the LIVE animated skeleton:
124
+
125
+ ```jsonc
126
+ { "name": "SwordMount", "type": "BoneAttachment3D",
127
+ "props": { "target": "../Skin", "bone": "RightHand" },
128
+ "children": [
129
+ { "name": "Blade", "type": "MeshInstance3D",
130
+ "props": { "mesh": "box", "size": [0.04, 0.04, 0.9], "position": [0, 0, 0.45],
131
+ "material": { "color": "#d8dde8", "metalness": 0.9, "roughness": 0.25 } } }
132
+ ] }
133
+ ```
134
+
135
+ - `target` = node path to the ModelInstance3D; `bone` = bone name. Lookup is
136
+ forgiving: `"RightHand"` also matches `mixamorigRightHand` /
137
+ `mixamorig:RightHand` (agent8's base-model is a Mixamo rig — `Head`,
138
+ `Spine2`, `LeftFoot`, `RightHandIndex1`…).
139
+ - The attachment's own `position`/`rotation` are a BONE-SPACE offset (grip
140
+ adjustments).
141
+ - Purely VISUAL: it follows the rendered skeleton, so headless the node stays
142
+ at its prop transform — keep hit checks range-based from the body, never
143
+ bone-based.
144
+ - `model.boneNames()` lists every bone at runtime when you need to hunt one.
145
+
120
146
  ## Facing a direction in 3D — the +Z-FORWARD rule (read before turning ANY skin)
121
147
 
122
148
  This trips people up REPEATEDLY, so here is the one rule. agent8's `base-model` (and
@@ -110,6 +110,19 @@ Save activates only when the working scene differs from the original
110
110
  (`Ctrl/Cmd+S`); undo is `Ctrl/Cmd+Z`. Saving writes pretty-printed JSON to
111
111
  `--output` (default: the input file).
112
112
 
113
+ ## Painting TileMap2D levels
114
+
115
+ Select a `TileMap2D` node and the inspector grows a **🖌 paint tiles** tool:
116
+ toggle it on and left-clicks (and drags) on the canvas paint cells with the
117
+ active brush. The palette chips offer every char already used in `cells`, the
118
+ `legend` chars, and an eraser (`␡` = `.`); the small text box takes any other
119
+ single char (digits map straight to atlas tile indices, other chars need a
120
+ `legend` entry). The grid grows right/down automatically when you paint past
121
+ the edge — to grow left/up, move the node instead (cell (0,0) hangs on the
122
+ node origin). Merged solid colliders re-derive live as you paint. Each painted
123
+ cell is one undo step; toggle paint off (or select another node) to get normal
124
+ click-select back.
125
+
113
126
  ## Generate environments
114
127
 
115
128
  The **✦ button** beside the add-node controls opens the Generate dialog — the
@@ -130,6 +130,20 @@ Signals: `finished`
130
130
  | `orderGroup` | `"default"` | one of: `background` `terrain` `default` `characters` `effects` `overlay` |
131
131
  | `mode` | `"screen"` | one of: `screen` `y` `none` |
132
132
 
133
+ ## `BoneAttachment3D` — `incanto/3d`
134
+
135
+ | Prop | Default | Kind |
136
+ |---|---|---|
137
+ | `position` | `[0,0,0]` | array |
138
+ | `rotation` | `[0,0,0]` | array |
139
+ | `static` | `false` | boolean |
140
+ | `scale` | `[1,1,1]` | array |
141
+ | `visible` | `true` | boolean |
142
+ | `renderOrder` | `0` | number |
143
+ | `orderGroup` | `"default"` | one of: `background` `terrain` `default` `characters` `effects` `overlay` |
144
+ | `target` | `""` | string |
145
+ | `bone` | `""` | string |
146
+
133
147
  ## `Camera2D` — `incanto/2d`
134
148
 
135
149
  | Prop | Default | Kind |
@@ -942,6 +956,7 @@ Signals: `totalChanged(total)`
942
956
  | `amount` | `10` | number |
943
957
  | `targetGroup` | `""` | string |
944
958
  | `oncePerTarget` | `true` | boolean |
959
+ | `repeatEvery` | `0` | number |
945
960
  | `destroySelf` | `false` | boolean |
946
961
 
947
962
  Signals: `dealtDamage(amount, target)`