@lewismoten/gamemaker-sandbox-tools 3.1.0 → 3.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.
Files changed (343) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/NOTICE.md +105 -3
  3. package/README.md +301 -15
  4. package/dist/audio-files.js +82 -0
  5. package/dist/audio.js +23 -138
  6. package/dist/block-merge.js +43 -0
  7. package/dist/color-reduce.js +44 -0
  8. package/dist/colors.js +87 -0
  9. package/dist/delta.js +75 -0
  10. package/dist/disk-diff.js +220 -0
  11. package/dist/drawing.js +83 -869
  12. package/dist/embroidery/compile.js +85 -0
  13. package/dist/embroidery/dst.js +79 -0
  14. package/dist/embroidery/exp.js +26 -0
  15. package/dist/embroidery/fill.js +49 -0
  16. package/dist/embroidery/geom.js +82 -0
  17. package/dist/embroidery/pes.js +79 -0
  18. package/dist/embroidery/satin.js +29 -0
  19. package/dist/embroidery/simulate.js +30 -0
  20. package/dist/embroidery/strokeFont.js +253 -0
  21. package/dist/embroidery/svg.js +24 -0
  22. package/dist/embroidery/types.js +13 -0
  23. package/dist/embroidery/units.js +26 -0
  24. package/dist/embroidery/validate.js +15 -0
  25. package/dist/formats/blocks.js +1 -103
  26. package/dist/formats/character.js +1 -83
  27. package/dist/formats/cmf.js +1 -37
  28. package/dist/formats/fli.js +1 -296
  29. package/dist/formats/fliLimits.js +1 -54
  30. package/dist/formats/game.js +1 -193
  31. package/dist/formats/gif.js +1 -125
  32. package/dist/formats/graphicScripts.js +1 -44
  33. package/dist/formats/map.js +1 -38
  34. package/dist/formats/monster.js +1 -69
  35. package/dist/formats/palette.js +1 -58
  36. package/dist/formats/recording.js +1 -17
  37. package/dist/formats/sound.js +1 -44
  38. package/dist/formats/voc.js +1 -303
  39. package/dist/gif-shrink.js +56 -0
  40. package/dist/image/png.js +42 -0
  41. package/dist/images.js +81 -43
  42. package/dist/kit/actors.js +19 -0
  43. package/dist/kit/align.js +204 -0
  44. package/dist/kit/blit.js +45 -0
  45. package/dist/kit/blockRoles.js +97 -0
  46. package/dist/kit/clips.js +40 -0
  47. package/dist/kit/coverPaint.js +18 -0
  48. package/dist/kit/disk.js +76 -0
  49. package/dist/kit/fadeOut.js +13 -0
  50. package/dist/kit/fliClips.js +133 -0
  51. package/dist/kit/fliShrink.js +277 -0
  52. package/dist/kit/gameSim.js +235 -0
  53. package/dist/kit/hopBot.js +142 -0
  54. package/dist/kit/levelGen.js +1423 -0
  55. package/dist/kit/levelGrid.js +33 -0
  56. package/dist/kit/levelPicture.js +27 -0
  57. package/dist/kit/menuVersion.js +19 -0
  58. package/dist/kit/microText.js +35 -0
  59. package/dist/kit/mumble.js +74 -0
  60. package/dist/kit/music.js +8 -0
  61. package/dist/kit/palRamps.js +32 -0
  62. package/dist/kit/palette.js +49 -0
  63. package/dist/kit/pcText.js +72 -0
  64. package/dist/kit/photo.js +150 -0
  65. package/dist/kit/pixels.js +79 -0
  66. package/dist/kit/png.js +40 -0
  67. package/dist/kit/quantize.js +72 -0
  68. package/dist/kit/raytrace.js +379 -0
  69. package/dist/kit/recordedDemo.js +10 -0
  70. package/dist/kit/reel.js +77 -0
  71. package/dist/kit/road3d.js +67 -0
  72. package/dist/kit/routeChecks.js +8 -0
  73. package/dist/kit/saveSlots.js +11 -0
  74. package/dist/kit/sceneInit.js +13 -0
  75. package/dist/kit/sceneSim.js +112 -0
  76. package/dist/kit/screenText.js +15 -0
  77. package/dist/kit/sdftext.js +237 -0
  78. package/dist/kit/shading.js +69 -0
  79. package/dist/kit/song.js +251 -0
  80. package/dist/kit/songFx.js +179 -0
  81. package/dist/kit/sound.js +52 -0
  82. package/dist/kit/synthParts.js +20 -0
  83. package/dist/kit/tar.js +53 -0
  84. package/dist/kit/textBounds.js +84 -0
  85. package/dist/kit/textfit.js +246 -0
  86. package/dist/kit/transforms.js +57 -0
  87. package/dist/kit/tune.js +21 -0
  88. package/dist/look-alike.js +50 -0
  89. package/dist/menu-version.js +4 -0
  90. package/dist/mesh/colorBodies.js +137 -0
  91. package/dist/mesh/decimate.js +207 -0
  92. package/dist/mesh/meshCheck.js +51 -0
  93. package/dist/mesh/overhang.js +41 -0
  94. package/dist/mesh/sampledField.js +12 -0
  95. package/dist/mesh/stl.js +36 -0
  96. package/dist/mesh/surfaceNets.js +79 -0
  97. package/dist/mesh/tetraMesh.js +62 -0
  98. package/dist/mesh/threeMf.js +58 -0
  99. package/dist/mesh/zipFile.js +52 -0
  100. package/dist/microFont.js +101 -0
  101. package/dist/music/compose.js +72 -0
  102. package/dist/pack/meshPack.js +198 -0
  103. package/dist/pack/threeMfPack.js +92 -0
  104. package/dist/palette-reserve.js +116 -0
  105. package/dist/palettes.js +138 -0
  106. package/dist/release-notes.js +40 -0
  107. package/dist/simulation.js +16 -2774
  108. package/dist/text.js +74 -0
  109. package/dist/types/audio.d.ts +4 -0
  110. package/dist/types/audioFiles.d.ts +22 -0
  111. package/dist/types/audioWav.d.ts +4 -0
  112. package/dist/types/blockMerge.d.ts +24 -0
  113. package/dist/types/colorReduce.d.ts +23 -0
  114. package/dist/types/{web/packages/tools/src/colors.d.ts → colors.d.ts} +6 -0
  115. package/dist/types/delta.d.ts +32 -0
  116. package/dist/types/diskDiff.d.ts +47 -0
  117. package/dist/types/drawing.d.ts +15 -0
  118. package/dist/types/embroidery/compile.d.ts +3 -0
  119. package/dist/types/embroidery/dst.d.ts +13 -0
  120. package/dist/types/embroidery/exp.d.ts +8 -0
  121. package/dist/types/embroidery/fill.d.ts +6 -0
  122. package/dist/types/embroidery/geom.d.ts +19 -0
  123. package/dist/types/embroidery/pes.d.ts +10 -0
  124. package/dist/types/embroidery/satin.d.ts +11 -0
  125. package/dist/types/embroidery/simulate.d.ts +19 -0
  126. package/dist/types/embroidery/strokeFont.d.ts +20 -0
  127. package/dist/types/embroidery/svg.d.ts +3 -0
  128. package/dist/types/embroidery/types.d.ts +70 -0
  129. package/dist/types/embroidery/units.d.ts +10 -0
  130. package/dist/types/embroidery/validate.d.ts +22 -0
  131. package/dist/types/formats/blocks.d.ts +1 -0
  132. package/dist/types/formats/character.d.ts +1 -0
  133. package/dist/types/formats/cmf.d.ts +1 -0
  134. package/dist/types/formats/fli.d.ts +1 -0
  135. package/dist/types/formats/fliLimits.d.ts +1 -0
  136. package/dist/types/formats/game.d.ts +1 -0
  137. package/dist/types/formats/gif.d.ts +1 -0
  138. package/dist/types/formats/graphicScripts.d.ts +1 -0
  139. package/dist/types/formats/map.d.ts +1 -0
  140. package/dist/types/formats/monster.d.ts +1 -0
  141. package/dist/types/formats/palette.d.ts +1 -0
  142. package/dist/types/formats/recording.d.ts +1 -0
  143. package/dist/types/formats/sound.d.ts +1 -0
  144. package/dist/types/formats/voc.d.ts +1 -0
  145. package/dist/types/gifShrink.d.ts +8 -0
  146. package/dist/types/image/animatedGif.d.ts +9 -0
  147. package/dist/types/image/surface.d.ts +26 -0
  148. package/dist/types/images.d.ts +13 -0
  149. package/dist/types/kit/actors.d.ts +7 -0
  150. package/dist/types/kit/align.d.ts +93 -0
  151. package/dist/types/kit/audioEvents.d.ts +26 -0
  152. package/dist/types/kit/blit.d.ts +20 -0
  153. package/dist/types/kit/blockRoles.d.ts +243 -0
  154. package/dist/types/{games/kit → kit}/clips.d.ts +1 -1
  155. package/dist/types/kit/coverPaint.d.ts +7 -0
  156. package/dist/types/kit/disk.d.ts +15 -0
  157. package/dist/types/kit/fadeOut.d.ts +12 -0
  158. package/dist/types/kit/fliClips.d.ts +32 -0
  159. package/dist/types/kit/fliShrink.d.ts +149 -0
  160. package/dist/types/{games/kit → kit}/gameSim.d.ts +9 -5
  161. package/dist/types/kit/hopBot.d.ts +72 -0
  162. package/dist/types/kit/laserClearance.d.ts +16 -0
  163. package/dist/types/kit/laserJoints.d.ts +39 -0
  164. package/dist/types/kit/laserLayout.d.ts +54 -0
  165. package/dist/types/kit/laserPixels.d.ts +52 -0
  166. package/dist/types/kit/laserPreview.d.ts +9 -0
  167. package/dist/types/kit/laserSvg.d.ts +35 -0
  168. package/dist/types/kit/levelGen/castle.d.ts +17 -0
  169. package/dist/types/kit/levelGen/dungeon.d.ts +11 -0
  170. package/dist/types/kit/levelGen/forest.d.ts +17 -0
  171. package/dist/types/kit/levelGen/furnish.d.ts +31 -0
  172. package/dist/types/kit/levelGen/grid.d.ts +46 -0
  173. package/dist/types/kit/levelGen/index.d.ts +138 -0
  174. package/dist/types/kit/levelGen/interior.d.ts +18 -0
  175. package/dist/types/kit/levelGen/jumpModel.d.ts +78 -0
  176. package/dist/types/kit/levelGen/needs.d.ts +44 -0
  177. package/dist/types/kit/levelGen/overworld.d.ts +21 -0
  178. package/dist/types/kit/levelGen/platform.d.ts +59 -0
  179. package/dist/types/kit/levelGen/platformCap.d.ts +13 -0
  180. package/dist/types/kit/levelGen/platformReach.d.ts +37 -0
  181. package/dist/types/kit/levelGen/props.d.ts +37 -0
  182. package/dist/types/kit/levelGen/town.d.ts +24 -0
  183. package/dist/types/kit/levelGrid.d.ts +16 -0
  184. package/dist/types/kit/levelPicture.d.ts +9 -0
  185. package/dist/types/kit/menuVersion.d.ts +7 -0
  186. package/dist/types/kit/microText.d.ts +18 -0
  187. package/dist/types/kit/mumble.d.ts +41 -0
  188. package/dist/types/kit/music.d.ts +1 -0
  189. package/dist/types/kit/palMerge.d.ts +10 -0
  190. package/dist/types/kit/palRamps.d.ts +28 -0
  191. package/dist/types/kit/pcText.d.ts +19 -0
  192. package/dist/types/kit/photo.d.ts +69 -0
  193. package/dist/types/kit/png.d.ts +7 -0
  194. package/dist/types/kit/quantize.d.ts +20 -0
  195. package/dist/types/kit/raytrace.d.ts +169 -0
  196. package/dist/types/kit/recordedDemo.d.ts +1 -0
  197. package/dist/types/kit/road3d.d.ts +71 -0
  198. package/dist/types/kit/routeChecks.d.ts +6 -0
  199. package/dist/types/kit/saveSlots.d.ts +17 -0
  200. package/dist/types/kit/sceneInit.d.ts +11 -0
  201. package/dist/types/{games/kit → kit}/sceneSim.d.ts +5 -5
  202. package/dist/types/kit/screenText.d.ts +3 -0
  203. package/dist/types/kit/sdftext.d.ts +34 -0
  204. package/dist/types/kit/shading.d.ts +23 -0
  205. package/dist/types/kit/shareBlocks.d.ts +20 -0
  206. package/dist/types/kit/song.d.ts +89 -0
  207. package/dist/types/kit/songFx.d.ts +99 -0
  208. package/dist/types/kit/synthParts.d.ts +7 -0
  209. package/dist/types/kit/tar.d.ts +13 -0
  210. package/dist/types/kit/textfit.d.ts +74 -0
  211. package/dist/types/kit/transforms.d.ts +8 -0
  212. package/dist/types/lookAlike.d.ts +31 -0
  213. package/dist/types/menuVersionEntry.d.ts +1 -0
  214. package/dist/types/mesh/colorBodies.d.ts +18 -0
  215. package/dist/types/mesh/decimate.d.ts +10 -0
  216. package/dist/types/mesh/fieldTrinket.d.ts +40 -0
  217. package/dist/types/mesh/figureShapes.d.ts +24 -0
  218. package/dist/types/mesh/mesh.d.ts +9 -0
  219. package/dist/types/mesh/meshCheck.d.ts +22 -0
  220. package/dist/types/mesh/overhang.d.ts +24 -0
  221. package/dist/types/mesh/pixelFigure.d.ts +41 -0
  222. package/dist/types/mesh/sampledField.d.ts +3 -0
  223. package/dist/types/mesh/sdfShapes.d.ts +20 -0
  224. package/dist/types/mesh/stl.d.ts +9 -0
  225. package/dist/types/mesh/strokeText.d.ts +8 -0
  226. package/dist/types/mesh/surfaceNets.d.ts +14 -0
  227. package/dist/types/mesh/tetraMesh.d.ts +4 -0
  228. package/dist/types/mesh/threeMf.d.ts +12 -0
  229. package/dist/types/mesh/trinketKinds.d.ts +72 -0
  230. package/dist/types/mesh/trinketTool.d.ts +26 -0
  231. package/dist/types/mesh/voxel.d.ts +10 -0
  232. package/dist/types/mesh/zipFile.d.ts +13 -0
  233. package/dist/types/microFont.d.ts +6 -0
  234. package/dist/types/pack/meshPack.d.ts +26 -0
  235. package/dist/types/pack/threeMfPack.d.ts +11 -0
  236. package/dist/types/palettePresetData.d.ts +4 -0
  237. package/dist/types/palettePresets.d.ts +12 -0
  238. package/dist/types/paletteReserve.d.ts +52 -0
  239. package/dist/types/palettes.d.ts +4 -0
  240. package/dist/types/releaseNotes.d.ts +3 -0
  241. package/dist/types/simulation.d.ts +6 -0
  242. package/dist/types/{web/packages/tools/src/text.d.ts → text.d.ts} +6 -6
  243. package/package.json +145 -15
  244. package/dist/binary-D7wuaC5g.js +0 -120
  245. package/dist/pixels-DzfIIUOl.js +0 -76
  246. package/dist/types/games/kit/blit.d.ts +0 -10
  247. package/dist/types/games/kit/music.d.ts +0 -1
  248. package/dist/types/games/kit/pcText.d.ts +0 -8
  249. package/dist/types/games/kit/shading.d.ts +0 -11
  250. package/dist/types/web/packages/tools/src/audio.d.ts +0 -3
  251. package/dist/types/web/packages/tools/src/drawing.d.ts +0 -10
  252. package/dist/types/web/packages/tools/src/images.d.ts +0 -2
  253. package/dist/types/web/packages/tools/src/microFont.d.ts +0 -1
  254. package/dist/types/web/packages/tools/src/simulation.d.ts +0 -3
  255. package/dist/types/web/scripts/cdGames.d.ts +0 -103
  256. package/dist/types/web/scripts/gameShots.d.ts +0 -12
  257. package/dist/types/web/scripts/ogImage.d.ts +0 -21
  258. package/dist/types/web/src/audio/cmfLoad.d.ts +0 -7
  259. package/dist/types/web/src/audio/cmfPlayer.d.ts +0 -69
  260. package/dist/types/web/src/audio/context.d.ts +0 -12
  261. package/dist/types/web/src/audio/engine.d.ts +0 -39
  262. package/dist/types/web/src/audio/music.worklet.d.ts +0 -14
  263. package/dist/types/web/src/audio/opl.d.ts +0 -37
  264. package/dist/types/web/src/audio/output.d.ts +0 -13
  265. package/dist/types/web/src/desk/boxes/boxFacts.d.ts +0 -85
  266. package/dist/types/web/src/dosPlayer/fileExtensions.d.ts +0 -44
  267. package/dist/types/web/src/dosPlayer/patchRules.d.ts +0 -24
  268. package/dist/types/web/src/dosPlayer/patchTable.d.ts +0 -80
  269. package/dist/types/web/src/edition.d.ts +0 -6
  270. package/dist/types/web/src/eggs/eggState.d.ts +0 -26
  271. package/dist/types/web/src/eggs/eggs.d.ts +0 -31
  272. package/dist/types/web/src/engine/character.d.ts +0 -30
  273. package/dist/types/web/src/engine/funcKeys.d.ts +0 -33
  274. package/dist/types/web/src/engine/game.d.ts +0 -52
  275. package/dist/types/web/src/engine/keys.d.ts +0 -17
  276. package/dist/types/web/src/engine/machine.d.ts +0 -99
  277. package/dist/types/web/src/engine/menus.d.ts +0 -46
  278. package/dist/types/web/src/engine/monsters.d.ts +0 -19
  279. package/dist/types/web/src/engine/playGain.d.ts +0 -11
  280. package/dist/types/web/src/engine/playerLook.d.ts +0 -26
  281. package/dist/types/web/src/engine/recorder.d.ts +0 -60
  282. package/dist/types/web/src/engine/render.d.ts +0 -8
  283. package/dist/types/web/src/engine/scene.d.ts +0 -156
  284. package/dist/types/web/src/engine/scroll.d.ts +0 -16
  285. package/dist/types/web/src/engine/showGraphic.d.ts +0 -39
  286. package/dist/types/web/src/engine/slowPc.d.ts +0 -62
  287. package/dist/types/web/src/engine/touch.d.ts +0 -33
  288. package/dist/types/web/src/engine/world.d.ts +0 -215
  289. package/dist/types/web/src/export/gameAbout.d.ts +0 -15
  290. package/dist/types/web/src/formats/binary.d.ts +0 -44
  291. package/dist/types/web/src/formats/blocks.d.ts +0 -52
  292. package/dist/types/web/src/formats/character.d.ts +0 -65
  293. package/dist/types/web/src/formats/cmf.d.ts +0 -33
  294. package/dist/types/web/src/formats/fli.d.ts +0 -45
  295. package/dist/types/web/src/formats/fliLimits.d.ts +0 -13
  296. package/dist/types/web/src/formats/game.d.ts +0 -72
  297. package/dist/types/web/src/formats/gif.d.ts +0 -15
  298. package/dist/types/web/src/formats/graphicScripts.d.ts +0 -18
  299. package/dist/types/web/src/formats/highscore.d.ts +0 -10
  300. package/dist/types/web/src/formats/map.d.ts +0 -24
  301. package/dist/types/web/src/formats/monster.d.ts +0 -48
  302. package/dist/types/web/src/formats/palette.d.ts +0 -15
  303. package/dist/types/web/src/formats/recording.d.ts +0 -7
  304. package/dist/types/web/src/formats/sound.d.ts +0 -13
  305. package/dist/types/web/src/formats/voc.d.ts +0 -13
  306. package/dist/types/web/src/gfx/cp437Glyphs.d.ts +0 -2
  307. package/dist/types/web/src/gfx/font8x8.d.ts +0 -2
  308. package/dist/types/web/src/gfx/levelPicture.d.ts +0 -81
  309. package/dist/types/web/src/gfx/screen.d.ts +0 -46
  310. package/dist/types/web/src/gfx/titlePicture.d.ts +0 -21
  311. package/dist/types/web/src/input/chords.d.ts +0 -22
  312. package/dist/types/web/src/input/deskMouse.d.ts +0 -14
  313. package/dist/types/web/src/input/keyboard.d.ts +0 -39
  314. package/dist/types/web/src/input/scancodes.d.ts +0 -3
  315. package/dist/types/web/src/manual/printables/types.d.ts +0 -277
  316. package/dist/types/web/src/project/bizarre.d.ts +0 -28
  317. package/dist/types/web/src/project/companion.d.ts +0 -35
  318. package/dist/types/web/src/project/diskFacts.d.ts +0 -30
  319. package/dist/types/web/src/project/files.d.ts +0 -124
  320. package/dist/types/web/src/project/gameFiles.d.ts +0 -49
  321. package/dist/types/web/src/project/gamePack.d.ts +0 -17
  322. package/dist/types/web/src/project/health.d.ts +0 -30
  323. package/dist/types/web/src/project/secretGames.d.ts +0 -19
  324. package/dist/types/web/src/project/storage.d.ts +0 -46
  325. package/dist/types/web/src/project/streamGame.d.ts +0 -38
  326. package/dist/types/web/src/project/zip.d.ts +0 -33
  327. package/dist/types/web/src/retro/dos/disks.d.ts +0 -33
  328. package/dist/types/web/src/retro/text/cp437.d.ts +0 -4
  329. package/dist/types/web/src/seededRandom.d.ts +0 -6
  330. package/dist/types/web/src/tinHearts/deskHearts.d.ts +0 -33
  331. package/dist/types/web/src/tinHearts/manifest.d.ts +0 -30
  332. package/dist/types/web/src/tinHearts/tinHearts.d.ts +0 -84
  333. package/dist/types/web/src/walkthrough/format.d.ts +0 -92
  334. package/dist/types/web/src/walkthrough/madeUpScores.d.ts +0 -6
  335. package/dist/types/web/src/walkthrough/runtime.d.ts +0 -134
  336. /package/dist/types/{web/src/assistant → image}/png.d.ts +0 -0
  337. /package/dist/types/{games/kit → kit}/palette.d.ts +0 -0
  338. /package/dist/types/{games/kit → kit}/pixels.d.ts +0 -0
  339. /package/dist/types/{games/kit → kit}/reel.d.ts +0 -0
  340. /package/dist/types/{games/kit → kit}/sound.d.ts +0 -0
  341. /package/dist/types/{games/kit → kit}/textBounds.d.ts +0 -0
  342. /package/dist/types/{games/kit → kit}/tune.d.ts +0 -0
  343. /package/dist/types/{web/src/audio → music}/compose.d.ts +0 -0
package/dist/text.js ADDED
@@ -0,0 +1,74 @@
1
+ import { FONT_CP437 as T } from "@lewismoten/gamemaker-sandbox-engine/gfx/cp437Glyphs";
2
+ import { FONT_CP437 as z } from "@lewismoten/gamemaker-sandbox-engine/gfx/cp437Glyphs";
3
+ import { toCp437 as M, fromCp437 as P } from "@lewismoten/gamemaker-sandbox-engine/text/cp437";
4
+ import { fromCp437 as D, toCp437 as J } from "@lewismoten/gamemaker-sandbox-engine/text/cp437";
5
+ import { Pixels as N } from "./kit/pixels.js";
6
+ import { MICRO_SQUARE_GLYPHS as Y, MICRO_GLYPHS as k } from "./microFont.js";
7
+ function G(e) {
8
+ for (const t of e)
9
+ if (t.charCodeAt(0) >= 128 && M(t) === t && P(t) !== t) throw new RangeError(`No CP437 glyph for ${t}`);
10
+ const i = M(e), n = new Uint8Array(i.length);
11
+ for (let t = 0; t < i.length; t++) {
12
+ const o = i.charCodeAt(t);
13
+ if (o > 255) throw new RangeError(`No CP437 glyph for ${i[t]}`);
14
+ n[t] = o;
15
+ }
16
+ return n;
17
+ }
18
+ function H(e, i = "cp437") {
19
+ if (!Number.isInteger(e) || e < 0 || e > 255) throw new RangeError("Glyph code must be 0..255");
20
+ if (i === "cp437") return T.slice(e * 8, e * 8 + 8);
21
+ const n = i === "micro-square" ? Y : k, t = P(String.fromCharCode(e)), o = n[t] ?? n[t.toUpperCase()] ?? n["?"];
22
+ return Uint8Array.from({ length: 5 }, (f, r) => {
23
+ let a = 0;
24
+ for (let s = 0; s < 3; s++) o[r * 3 + s] === "1" && (a |= 1 << s);
25
+ return a;
26
+ });
27
+ }
28
+ function F(e, i, n = 1, t = 2) {
29
+ if (x(i), !Number.isInteger(n) || !Number.isInteger(t)) throw new RangeError("Shadow offsets must be integers");
30
+ const o = new N(e.w, e.h, 255);
31
+ for (let f = 0; f < e.h; f++) for (let r = 0; r < e.w; r++) e.get(r, f) !== 255 && o.set(r + n, f + t, i);
32
+ return o.blit(e, 0, 0, 255);
33
+ }
34
+ function x(e) {
35
+ if (!Number.isInteger(e) || e < 0 || e > 254) throw new RangeError("Ink must be a palette index 0..254");
36
+ }
37
+ function Q(e, i = {}) {
38
+ const { font: n = "cp437", color: t = 0, scale: o = 1, outline: f, shadow: r } = i;
39
+ if (x(t), f !== void 0 && x(f), r && x(r.color), !Number.isSafeInteger(o) || o < 1) throw new RangeError("Scale must be a positive integer");
40
+ const a = r?.dx ?? 1, s = r?.dy ?? 2;
41
+ if (!Number.isSafeInteger(a) || !Number.isSafeInteger(s)) throw new RangeError("Shadow offsets must be integers");
42
+ const y = typeof e == "string" ? e.replaceAll(`\r
43
+ `, `
44
+ `).split(`
45
+ `).map(G) : [e], R = Math.max(...y.map((h) => h.length));
46
+ if (!R) return { width: 0, height: 0, pixels: new Uint8Array(), originX: 0, originY: 0 };
47
+ const S = n === "cp437" ? 8 : 3, C = n === "cp437" ? 8 : 5, A = n === "cp437" ? 8 : 4, p = f === void 0 ? 0 : 1, E = Math.min(-p, r ? a : 0), I = Math.min(-p, r ? s : 0), _ = Math.max(p, r ? a : 0), v = Math.max(p, r ? s : 0), m = ((R - 1) * A + S) * o + _ - E, w = ((y.length - 1) * (C + 1) + C) * o + v - I, u = new N(m, w, 255);
48
+ y.forEach(
49
+ (h, c) => h.forEach((l, g) => {
50
+ H(l, n).forEach((U, O) => {
51
+ for (let b = 0; b < S; b++)
52
+ U & 1 << b && u.rect((g * A + b) * o - E, (c * (C + 1) + O) * o - I, o, o, t);
53
+ });
54
+ })
55
+ );
56
+ const d = new N(m, w, 255);
57
+ if (r && d.blit(F(u, r.color, a, s), 0, 0, 255), f !== void 0) {
58
+ for (let h = 0; h < w; h++)
59
+ for (let c = 0; c < m; c++)
60
+ if (u.get(c, h) !== 255) for (let l = -1; l <= 1; l++) for (let g = -1; g <= 1; g++) d.set(c + g, h + l, f);
61
+ }
62
+ return d.blit(u, 0, 0, 255), { width: m, height: w, pixels: d.px, originX: -E, originY: -I };
63
+ }
64
+ export {
65
+ z as FONT_CP437,
66
+ k as MICRO_GLYPHS,
67
+ Y as MICRO_SQUARE_GLYPHS,
68
+ F as dropShadow,
69
+ G as encodeText,
70
+ D as fromCp437,
71
+ H as glyphRows,
72
+ Q as renderText,
73
+ J as toCp437
74
+ };
@@ -0,0 +1,4 @@
1
+ export * from './music/compose.js';
2
+ export * from './kit/tune.js';
3
+ export * from './kit/sound.js';
4
+ export * from './kit/synthParts.js';
@@ -0,0 +1,22 @@
1
+ export interface AudioFileOptions {
2
+ /** Output mono sample rate. Defaults to Game-Maker's usual 11025 Hz. */
3
+ sampleRate?: number;
4
+ /** Executable name or path; FFmpeg is installed separately, never bundled. */
5
+ ffmpegPath?: string;
6
+ /** Maximum decoded mono samples (default 16 MiB). Exceeding it fails, never truncates. */
7
+ maxSamples?: number;
8
+ /** Maximum conversion time, in milliseconds (default 30000). */
9
+ timeoutMs?: number;
10
+ }
11
+ export interface VocFileOptions extends Omit<AudioFileOptions, 'maxSamples'> {
12
+ /** Maximum total VOC bytes, including headers (default 65535, the DOS size limit). */
13
+ maxBytes?: number;
14
+ }
15
+ /**
16
+ * Decode FLAC, Ogg, WAV or another FFmpeg-supported file to mono samples for encodeVoc.
17
+ * The unsigned-byte mapping deliberately inverts encodeVoc, retaining all original PCM
18
+ * values when lossless sources are decoded at their own sample rate. Other rates resample.
19
+ */
20
+ export declare function decodeAudioFile(file: string | URL, options?: AudioFileOptions): Float32Array;
21
+ /** Convert source audio to a native mono, unsigned 8-bit VOC, enforcing DOS's size limit. */
22
+ export declare function audioFileToVoc(file: string | URL, options?: VocFileOptions): Uint8Array;
@@ -0,0 +1,4 @@
1
+ export declare function pcm8Wav(bytes: Uint8Array): {
2
+ samples: Uint8Array;
3
+ sampleRate: number;
4
+ } | undefined;
@@ -0,0 +1,24 @@
1
+ import { type Block } from '@lewismoten/gamemaker-sandbox-engine/formats/blocks';
2
+ import type { GameMap } from '@lewismoten/gamemaker-sandbox-engine/formats/map';
3
+ export interface BblMergeInput {
4
+ keep: Block[];
5
+ drop: Block[];
6
+ /** The dropped set's maps (every map its scenes open); each is renumbered. */
7
+ dropMaps: GameMap[];
8
+ /** Block numbers of the dropped set its maps draw, with everything those turn into. */
9
+ dropUsed: ReadonlySet<number>;
10
+ /** Numbers that must keep their number in the dropped set (pickups, required and starting inventory, 0). */
11
+ dropPinned: ReadonlySet<number>;
12
+ /** Slots of the kept set that are in use (drawn, linked to, or pinned): never given away even if they look blank. */
13
+ keepUsed: ReadonlySet<number>;
14
+ }
15
+ export interface BblMerge {
16
+ blocks: Block[];
17
+ maps: GameMap[];
18
+ /** Where each of the dropped set's drawn blocks is now. */
19
+ at: Map<number, number>;
20
+ /** The dropped blocks that moved into a slot of their own (the others reuse a twin). */
21
+ fresh: number[];
22
+ }
23
+ /** The merge, or why the two sets can't share one file. */
24
+ export declare function mergeBackgroundSets(input: BblMergeInput): BblMerge | string;
@@ -0,0 +1,23 @@
1
+ import type { Block } from '@lewismoten/gamemaker-sandbox-engine/formats/blocks';
2
+ export declare const FLAG_MEAN = 6;
3
+ export declare const FLAG_WORST = 20;
4
+ type Lab = [number, number, number];
5
+ /** CIELAB of palette color `i` (palette bytes are 6-bit VGA values). */
6
+ export declare function labOf(palette: Uint8Array, i: number): Lab;
7
+ export interface ReduceScore {
8
+ /** Mean delta E over the pixels that changed color, and over every pixel of the changed blocks. */
9
+ mean: number;
10
+ worst: number;
11
+ /** Blocks that passed a threshold. */
12
+ flagged: number[];
13
+ }
14
+ export interface ReduceResult {
15
+ /** Block number to its new pixels, only for blocks that changed. */
16
+ changed: Map<number, Uint8Array>;
17
+ /** Each color index that moved and where it went. */
18
+ moves: Map<number, number>;
19
+ score: ReduceScore;
20
+ }
21
+ /** The blocks `which` with every pixel outside `allowed` (and not 0 or 255) moved to the nearest allowed color in `palettes[0]`; scored under every palette. */
22
+ export declare function reduceBlocks(blocks: Block[], which: Iterable<number>, palettes: Uint8Array[], allowed: ReadonlySet<number>): ReduceResult;
23
+ export {};
@@ -1,4 +1,10 @@
1
1
  export type RGB = readonly [number, number, number];
2
+ /** Hue in degrees, saturation and value in 0..1. */
3
+ export type HSV = readonly [number, number, number];
4
+ /** Convert eight-bit RGB to hue, saturation and value without changing the input. */
5
+ export declare function rgbToHsv(color: RGB): [number, number, number];
6
+ /** Convert HSV to rounded eight-bit RGB; hue wraps around at 360 degrees. */
7
+ export declare function hsvToRgb(color: HSV): [number, number, number];
2
8
  export type TimeOfDay = 'morning' | 'noon' | 'afternoon' | 'sunset' | 'night' | 'show';
3
9
  export interface Lighting {
4
10
  readonly mul: RGB;
@@ -0,0 +1,32 @@
1
+ export type FileState = Uint8Array;
2
+ /** A file in a delta: new whole, changed by patches, or gone. */
3
+ export type FileDelta = {
4
+ kind: 'new';
5
+ bytes: Uint8Array;
6
+ } | {
7
+ kind: 'bytes';
8
+ length: number;
9
+ patches: {
10
+ at: number;
11
+ bytes: Uint8Array;
12
+ }[];
13
+ } | {
14
+ kind: 'lines';
15
+ start: number;
16
+ remove: number;
17
+ add: string[];
18
+ } | {
19
+ kind: 'gone';
20
+ };
21
+ /** What changed between two versions of a game: only the files that differ. */
22
+ export type Delta = Record<string, FileDelta>;
23
+ /** The difference that turns `from` (undefined: no such file) into `to` (undefined: removed); undefined when they are the same. */
24
+ export declare function diffFile(name: string, from: FileState | undefined, to: FileState | undefined): FileDelta | undefined;
25
+ /** The file after a delta; undefined when it is gone. */
26
+ export declare function patchFile(from: FileState | undefined, d: FileDelta): FileState | undefined;
27
+ /** The delta between two whole versions (file name to bytes). */
28
+ export declare function diffVersions(from: ReadonlyMap<string, FileState>, to: ReadonlyMap<string, FileState>): Delta;
29
+ /** A version with a delta applied. */
30
+ export declare function applyDelta(from: ReadonlyMap<string, FileState>, delta: Delta): Map<string, FileState>;
31
+ /** Bytes a delta takes to store (patch bytes, new files, added lines), to show what a version costs. */
32
+ export declare function deltaSize(delta: Delta): number;
@@ -0,0 +1,47 @@
1
+ export type DiskFiles = ReadonlyMap<string, Uint8Array>;
2
+ export interface ChangedFile {
3
+ name: string;
4
+ kind: string;
5
+ before: number;
6
+ after: number;
7
+ summary: string[];
8
+ }
9
+ export interface DiskDiff {
10
+ added: {
11
+ name: string;
12
+ kind: string;
13
+ size: number;
14
+ }[];
15
+ removed: {
16
+ name: string;
17
+ kind: string;
18
+ size: number;
19
+ }[];
20
+ changed: ChangedFile[];
21
+ unchanged: number;
22
+ }
23
+ /** What a file is, by its first bytes when they say, else by its extension. */
24
+ export declare function sniffKind(name: string, bytes: Uint8Array): string;
25
+ /** Numbers as ranges: 3,4,5,9 -> "3-5, 9". Long lists are cut. */
26
+ export declare function ranges(nums: number[], max?: number): string;
27
+ /** Lines added and removed: shared head and tail dropped, then a longest-common-subsequence. */
28
+ export declare function lineDiff(a: string[], b: string[]): {
29
+ added: number;
30
+ removed: number;
31
+ };
32
+ /** Changed map cells grouped into clusters (cells within 3 of each other), as bounding boxes. */
33
+ export declare function cellClusters(cells: number[], width: number): {
34
+ count: number;
35
+ x0: number;
36
+ y0: number;
37
+ x1: number;
38
+ y1: number;
39
+ }[];
40
+ /** A short plain-text summary of how one file changed; a parse failure falls back to bytes. */
41
+ export declare function summarizeChange(name: string, a: Uint8Array, b: Uint8Array): {
42
+ kind: string;
43
+ summary: string[];
44
+ };
45
+ export declare function diffDisks(a: DiskFiles, b: DiskFiles): DiskDiff;
46
+ /** The plain-text report: counts, then added, removed, and changed files with their summaries. */
47
+ export declare function formatDiff(d: DiskDiff): string;
@@ -0,0 +1,15 @@
1
+ export * from './kit/pixels.js';
2
+ export * from './kit/palette.js';
3
+ export * from './kit/pcText.js';
4
+ export * from './kit/blit.js';
5
+ export * from './kit/shading.js';
6
+ export * from './kit/textBounds.js';
7
+ export * from './kit/reel.js';
8
+ export { FONT8X8 } from '@lewismoten/gamemaker-sandbox-engine/gfx/font8x8';
9
+ export * from './text.js';
10
+ export * from './colors.js';
11
+ export * from './kit/microText.js';
12
+ export { microGlyphs, type MicroGlyphs } from './microFont.js';
13
+ export * from './kit/transforms.js';
14
+ export * from './kit/coverPaint.js';
15
+ export * from './kit/palRamps.js';
@@ -0,0 +1,3 @@
1
+ import { type Design, type Params, type Pattern } from './types.js';
2
+ /** Compiles the design to stitches, ending with an 'end' command; the threads are the blocks' threads in order. */
3
+ export declare function compile(design: Design, params?: Partial<Params>): Pattern;
@@ -0,0 +1,13 @@
1
+ import type { Pattern, Stitch } from './types.js';
2
+ /** The DST file for a pattern. */
3
+ export declare function writeDst(pattern: Pattern): Uint8Array;
4
+ /** Reads a DST back into absolute stitches in mm (jumps and color changes included; the header counts are checked by the caller). */
5
+ export declare function readDst(bytes: Uint8Array): {
6
+ stitches: Stitch[];
7
+ colorChanges: number;
8
+ label: string;
9
+ declared: {
10
+ stitches: number;
11
+ colors: number;
12
+ };
13
+ };
@@ -0,0 +1,8 @@
1
+ import type { Pattern, Stitch } from './types.js';
2
+ /** The EXP file for a pattern. */
3
+ export declare function writeExp(pattern: Pattern): Uint8Array;
4
+ /** Reads an EXP back into absolute stitches in mm; the end is where the data stops. */
5
+ export declare function readExp(bytes: Uint8Array): {
6
+ stitches: Stitch[];
7
+ colorChanges: number;
8
+ };
@@ -0,0 +1,6 @@
1
+ import type { Poly, Pt } from './types.js';
2
+ /**
3
+ * The chains of needle points that fill the outlines with rows at `angle` degrees. Each chain is sewn in order; moving
4
+ * between chains is the caller's job.
5
+ */
6
+ export declare function tatami(polys: Poly[], angle: number, spacing: number, len: number): Pt[][];
@@ -0,0 +1,19 @@
1
+ import type { Poly, Pt } from './types.js';
2
+ export declare const dist: (a: Pt, b: Pt) => number;
3
+ /** A circle as a polygon of `n` points, counter-clockwise from the right. */
4
+ export declare function circle(cx: number, cy: number, r: number, n?: number): Poly;
5
+ /** A star with `points` tips (first tip at `start` radians) between an inner and an outer radius. */
6
+ export declare function star(cx: number, cy: number, inner: number, outer: number, points: number, start?: number): Poly;
7
+ /** Points on an elliptical arc from angle a0 to a1 (radians), `n` segments. */
8
+ export declare function arc(cx: number, cy: number, rx: number, ry: number, a0: number, a1: number, n?: number): Pt[];
9
+ /** Signed area (positive when counter-clockwise). */
10
+ export declare function area(p: Poly): number;
11
+ /** The outline moved `d` mm inward (outward when negative), mitered at the corners with the miter length capped. */
12
+ export declare function inset(p: Poly, d: number): Poly;
13
+ /** Even-odd containment in any of the outlines. */
14
+ export declare function inside(polys: Poly[], pt: Pt): boolean;
15
+ /** The path cut into points about `step` mm apart along it (its corners are kept). Closed paths return to the start. */
16
+ export declare function resample(path: Pt[], step: number, closed?: boolean): Pt[];
17
+ /** The path cut at even spacing by arc length (corners are not kept), for satin. */
18
+ export declare function evenly(path: Pt[], step: number, closed?: boolean): Pt[];
19
+ export declare const rotate: (p: Pt, a: number) => Pt;
@@ -0,0 +1,10 @@
1
+ import type { Pattern, Stitch } from './types.js';
2
+ /** The PES file for a pattern. */
3
+ export declare function writePes(pattern: Pattern): Uint8Array;
4
+ /** Reads a PES back (the PEC section) into absolute stitches in mm. */
5
+ export declare function readPes(bytes: Uint8Array): {
6
+ stitches: Stitch[];
7
+ colorChanges: number;
8
+ threads: number;
9
+ label: string;
10
+ };
@@ -0,0 +1,11 @@
1
+ import type { Pt } from './types.js';
2
+ /**
3
+ * The needle points of a satin column along `path` (closed paths end where they began).
4
+ * Each lane is one list; a column up to `maxWidth` is a single lane.
5
+ */
6
+ export declare function satin(path: Pt[], width: number, density: number, closed: boolean, maxWidth: number): Pt[][];
7
+ /**
8
+ * Underlay for a satin column: a walk down its center, and a loose zigzag a little narrower than the column when it is
9
+ * wide enough to need one.
10
+ */
11
+ export declare function satinUnderlay(path: Pt[], width: number, run: number, closed: boolean): Pt[][];
@@ -0,0 +1,19 @@
1
+ import type { Pattern, RGB } from './types.js';
2
+ export interface Picture {
3
+ w: number;
4
+ h: number;
5
+ rgb: Uint8Array;
6
+ }
7
+ export interface SimOptions {
8
+ /** Picture size in mm (square), centered on 0,0. */
9
+ size: number;
10
+ pxPerMm: number;
11
+ /** Thread width, mm (about 0.4 for 40 weight thread, drawn a little heavier to read at small size). */
12
+ thread?: number;
13
+ /** Backing fabric color. */
14
+ backing?: RGB;
15
+ /** The mm point at the middle of the picture (default 0,0), to look closely at one part. */
16
+ center?: [number, number];
17
+ }
18
+ /** Draws the pattern. */
19
+ export declare function simulate(pattern: Pattern, o: SimOptions): Picture;
@@ -0,0 +1,20 @@
1
+ import type { Pt } from './types.js';
2
+ export interface ArcTextOptions {
3
+ /** Center of the circle. */
4
+ cx: number;
5
+ cy: number;
6
+ /** Radius of the letters' baselines (their feet), mm; the stroke centers run from here out (top) or in (bottom). */
7
+ baseline: number;
8
+ /** Height of the letters in mm (stroke center to stroke center). */
9
+ height: number;
10
+ /** Gap between letters, mm. */
11
+ gap: number;
12
+ /** 'top' reads left to right over the top with feet toward the center; 'bottom' reads left to right under the bottom with heads toward the center. */
13
+ side: 'top' | 'bottom';
14
+ /** Stretches the letters sideways (1 = as drawn). */
15
+ stretch?: number;
16
+ /** Where the middle of the word sits, radians (default: straight up for top, straight down for bottom). */
17
+ center?: number;
18
+ }
19
+ /** The strokes (as paths of points, mm) that spell `text` bent around the circle. */
20
+ export declare function arcText(text: string, o: ArcTextOptions): Pt[][];
@@ -0,0 +1,3 @@
1
+ import type { Design, RGB } from './types.js';
2
+ /** The SVG text of the design, `margin` mm of backing around a square of `size` mm. */
3
+ export declare function designSvg(design: Design, size: number, backing?: RGB): string;
@@ -0,0 +1,70 @@
1
+ export type Pt = [number, number];
2
+ /** A closed outline (the last point joins the first). */
3
+ export type Poly = Pt[];
4
+ export type RGB = [number, number, number];
5
+ export interface Thread {
6
+ /** A generic color name ("midnight navy"), not a brand. */
7
+ name: string;
8
+ rgb: RGB;
9
+ /** Brother PEC thread-chart index (1-64) for the PES file; the machine shows its own color for it. */
10
+ pec?: number;
11
+ }
12
+ /** What the needle does next: sew to the point, move without sewing, cut the thread then move, change thread, or finish. */
13
+ export type Cmd = 'stitch' | 'jump' | 'trim' | 'color' | 'end';
14
+ export interface Stitch {
15
+ x: number;
16
+ y: number;
17
+ cmd: Cmd;
18
+ }
19
+ export interface Pattern {
20
+ name: string;
21
+ threads: Thread[];
22
+ stitches: Stitch[];
23
+ }
24
+ /** A shape filled with tatami (rows of stitches), under an optional underlay. */
25
+ export interface FillItem {
26
+ kind: 'fill';
27
+ polys: Poly[];
28
+ /** Direction of the rows, degrees. Regions should alternate it. */
29
+ angle: number;
30
+ }
31
+ /** A column of satin zigzag along a line, `width` mm wide (split into lanes beyond 7 mm). */
32
+ export interface SatinItem {
33
+ kind: 'satin';
34
+ path: Pt[];
35
+ width: number;
36
+ closed?: boolean;
37
+ }
38
+ /** A plain line of running stitches. */
39
+ export interface RunItem {
40
+ kind: 'run';
41
+ path: Pt[];
42
+ closed?: boolean;
43
+ }
44
+ export type Item = FillItem | SatinItem | RunItem;
45
+ /** Everything sewn in one thread, in order; a color change comes between blocks. */
46
+ export interface Block {
47
+ thread: Thread;
48
+ items: Item[];
49
+ }
50
+ export interface Design {
51
+ name: string;
52
+ /** The hoop's sewing field in mm. */
53
+ hoop: [number, number];
54
+ /** Blocks in sewing order. */
55
+ blocks: Block[];
56
+ }
57
+ /** The tuning numbers of the generator, in mm. */
58
+ export interface Params {
59
+ fillSpacing: number;
60
+ fillLength: number;
61
+ satinDensity: number;
62
+ /** Extra satin width (total) so the thread draws in and still covers its shape. */
63
+ pullComp: number;
64
+ /** Outline growth of fills for the same reason. */
65
+ fillGrow: number;
66
+ maxStitch: number;
67
+ underlayRun: number;
68
+ maxSatin: number;
69
+ }
70
+ export declare const DEFAULTS: Params;
@@ -0,0 +1,10 @@
1
+ import type { Cmd, Pattern } from './types.js';
2
+ export interface Move {
3
+ dx: number;
4
+ dy: number;
5
+ cmd: Cmd;
6
+ }
7
+ /** Cut-off for one record's move in either direction, in tenths of a millimeter (Tajima DST's limit; EXP and PES take more). */
8
+ export declare const MAX_MOVE = 121;
9
+ /** The pattern's records. Positions are rounded as absolute tenths, so rounding never builds up along a long run. */
10
+ export declare function toRecords(pattern: Pattern, maxMove?: number): Move[];
@@ -0,0 +1,22 @@
1
+ import type { Stitch } from './types.js';
2
+ export interface Report {
3
+ stitches: number;
4
+ jumps: number;
5
+ colorChanges: number;
6
+ /** Longest sewn stitch and longest single jump record, mm. */
7
+ maxStitch: number;
8
+ maxJump: number;
9
+ /** Extents of every needle position, mm: [minX, minY, maxX, maxY]. */
10
+ extents: [number, number, number, number];
11
+ width: number;
12
+ height: number;
13
+ problems: string[];
14
+ }
15
+ export interface Expect {
16
+ hoop: [number, number];
17
+ /** Number of thread colors; the file must change color this many minus one times. */
18
+ colors: number;
19
+ /** The longest single record the format allows, mm (12.1 for DST). */
20
+ maxRecord: number;
21
+ }
22
+ export declare function validate(list: Stitch[], want: Expect): Report;
@@ -0,0 +1 @@
1
+ export * from '@lewismoten/gamemaker-sandbox-engine/formats/blocks';
@@ -0,0 +1 @@
1
+ export * from '@lewismoten/gamemaker-sandbox-engine/formats/character';
@@ -0,0 +1 @@
1
+ export * from '@lewismoten/gamemaker-sandbox-engine/formats/cmf';
@@ -0,0 +1 @@
1
+ export * from '@lewismoten/gamemaker-sandbox-engine/formats/fli';
@@ -0,0 +1 @@
1
+ export * from '@lewismoten/gamemaker-sandbox-engine/formats/fliLimits';
@@ -0,0 +1 @@
1
+ export * from '@lewismoten/gamemaker-sandbox-engine/formats/game';
@@ -0,0 +1 @@
1
+ export * from '@lewismoten/gamemaker-sandbox-engine/formats/gif';
@@ -0,0 +1 @@
1
+ export * from '@lewismoten/gamemaker-sandbox-engine/formats/graphicScripts';
@@ -0,0 +1 @@
1
+ export * from '@lewismoten/gamemaker-sandbox-engine/formats/map';
@@ -0,0 +1 @@
1
+ export * from '@lewismoten/gamemaker-sandbox-engine/formats/monster';
@@ -0,0 +1 @@
1
+ export * from '@lewismoten/gamemaker-sandbox-engine/formats/palette';
@@ -0,0 +1 @@
1
+ export * from '@lewismoten/gamemaker-sandbox-engine/formats/recording';
@@ -0,0 +1 @@
1
+ export * from '@lewismoten/gamemaker-sandbox-engine/formats/sound';
@@ -0,0 +1 @@
1
+ export * from '@lewismoten/gamemaker-sandbox-engine/formats/voc';
@@ -0,0 +1,8 @@
1
+ export interface GifShrink {
2
+ bytes: Uint8Array;
3
+ /** Table size before and after. */
4
+ from: number;
5
+ to: number;
6
+ }
7
+ /** The smaller file, or undefined when the table can't shrink without changing what PLAYGAME shows. */
8
+ export declare function shrinkGif(bytes: Uint8Array): GifShrink | undefined;
@@ -0,0 +1,9 @@
1
+ export interface AnimatedFrame {
2
+ /** width * height palette indexes. */
3
+ pixels: Uint8Array;
4
+ /** 768 bytes, 6 bits per channel. */
5
+ palette: Uint8Array;
6
+ /** Hundredths of a second this frame shows. */
7
+ delay: number;
8
+ }
9
+ export declare function encodeAnimatedGif(width: number, height: number, frames: AnimatedFrame[]): Uint8Array;
@@ -0,0 +1,26 @@
1
+ import { Pixels } from '../kit/pixels.js';
2
+ export type SurfaceMirror = 'none' | 'h' | 'v' | 'both';
3
+ /** The pixel and its mirror images across the whole picture, without repeats. */
4
+ export declare function mirrorAll(x: number, y: number, w: number, h: number, mirror: SurfaceMirror): [number, number][];
5
+ type Plot = (x: number, y: number) => void;
6
+ /** Every pixel of a straight line from a to b. */
7
+ export declare function line(a: {
8
+ x: number;
9
+ y: number;
10
+ }, b: {
11
+ x: number;
12
+ y: number;
13
+ }, plot: Plot): void;
14
+ /** The outline of the box with corners a and b. */
15
+ export declare function box(a: {
16
+ x: number;
17
+ y: number;
18
+ }, b: {
19
+ x: number;
20
+ y: number;
21
+ }, plot: Plot): void;
22
+ /** Fills one four-connected color region. A mask and writer can preserve missing or shared tiles. */
23
+ export declare function floodFill(px: Uint8Array, w: number, h: number, x: number, y: number, v: number, allowed?: (x: number, y: number) => boolean, paint?: (x: number, y: number, value: number) => void): void;
24
+ /** Move indexed pixels with wrapping at each edge; the input is unchanged. */
25
+ export declare function shiftPixels(src: Pixels, dx: number, dy: number): Pixels;
26
+ export {};
@@ -0,0 +1,13 @@
1
+ export { encodePng, type IndexedPicture } from './image/png.js';
2
+ export { crc32 } from '@lewismoten/gamemaker-sandbox-archives/zip';
3
+ export { Pixels } from './kit/pixels.js';
4
+ export { flipX, flipY, turn90, turn180 } from './kit/transforms.js';
5
+ export { mirrorAll, line, box, floodFill, shiftPixels, type SurfaceMirror } from './image/surface.js';
6
+ /** Portable RGBA pixels; accepts ImageData without requiring canvas or a DOM. RGB is treated as opaque. */
7
+ export interface RgbaPixels {
8
+ width: number;
9
+ height: number;
10
+ data: ArrayLike<number>;
11
+ }
12
+ /** Median cut over the given RGBA images: up to `colors` 8-bit colors. */
13
+ export declare function medianCutRgba(images: readonly RgbaPixels[], colors?: number): [number, number, number][];
@@ -0,0 +1,7 @@
1
+ import { type Frame, type Sequence } from '@lewismoten/gamemaker-sandbox-engine/formats/character';
2
+ import { type March, type Monster } from '@lewismoten/gamemaker-sandbox-engine/formats/monster';
3
+ export declare function set(s: Sequence, frames: Frame[], o?: Partial<Omit<Sequence, 'frames'>>): void;
4
+ export declare function mon(pics: [number, number][], o: Partial<Monster>, path?: March[]): Monster;
5
+ export declare const corner: (x: number, y: number, speed: number, orient?: number) => March;
6
+ /** Back and forth `run` blocks (to the right first) at `speed`, facing the way it goes. */
7
+ export declare const pace: (run: number, speed: number, dy?: number) => March[];