Appearance
hm05
Preview, publish and build HereSplash animation projects from a terminal or VS Code. The hm05 command talks to the running hm05 desktop app (and starts it when it is closed); there is nothing to configure.
bash
npm install --save-dev hm05
npx hm05 preview # play the project in the preview window
npx hm05 preview --watch # again on every save
npx hm05 publish # publish to output/ with the document's own settings
npx hm05 build # bundle the player scripts, report errors
npx hm05 open # open this project in hm05
npx hm05 init # add package.json scripts, tsconfig.json, .gitignore, VS Code tasksRun it inside an hm05 project folder (a document saved as a folder: the folder with doc.json). Errors come out as scripts/Hero.ts:12:4: error: message, so VS Code's problem matcher (set up by hm05 init) links them.
Types for player scripts
The package ships the declarations of the hm05 player (pixi-hm05). A project's tsconfig.json maps the module name to them:
json
{ "compilerOptions": { "paths": { "pixi-hm05": ["./node_modules/hm05/types/pixi-hm05/index.d.ts"] } } }ts
import { Behaviour } from "pixi-hm05";
export default class Hero extends Behaviour {
static fields = { speed: { type: "number", default: 3 } };
onEnterFrame() {
this.clip.x += Number(this.fields.speed);
}
}npm packages the scripts import (npm install gsap) are bundled into the published page by the desktop app; pixi.js, pixi-filters and pixi-hm05 are always the page's own copy.
Command reference
hm05 help prints:
text
hm05 — the hm05 animation editor from a terminal
hm05 preview [--watch] [--debug]
play the project in the preview window (--watch: again on every save;
--debug: start hm05 with the DevTools port 9333 for VS Code breakpoints)
hm05 publish publish to output/ with the document's own publish settings
hm05 build bundle the scripts only and report errors
hm05 test [--frames N] play the project headless for N frames (default 120) with its
scripts; the page's console is printed here, exit 1 on errors
hm05 open open this project in hm05
hm05 init add package.json, tsconfig.json, .gitignore and VS Code tasks
Run it inside an hm05 project folder (the folder with doc.json), or name the
project after the command: hm05 build ../game (a folder, its doc.json or its
.xh5 index) — that document is used, whichever tab is active in hm05. The
hm05 desktop app is found automatically and started when it is not running.JavaScript API
The package's module (import { … } from "hm05", and hm05/project-files) finds and drives the desktop app and holds the project-file rules hm05 init uses. Its members are listed below.