This private NPM module graphically renders game states. This repository houses the authoritative JSON schema.
Currently the only supported output format is SVG. The library has been tested and works correctly in Chrome, Firefox, Opera, and Edge.
A playground/demo area is now available. The Abstract Play Designer is another place you can interact with the rendering engine.
In the browser, simply load APRender.js via a <script> tag. For a concrete example, see the playground.
From within Node, simply import the variables and functions you need. Both methods give you access to the same API.
The API and schema are documented on the docs site.
If you want to create a new set of graphics, see Adding pieces and the contact sheet for existing piece names. After changing glyph sheets, run npm run contact-sheet and commit docs/contact-sheet.svg and contact.png.
The main website houses the development blog and wiki. We encourage coders to join us on Discord (https://discord.abstractplay.com) in our #dev-curious channel if you have questions, and basic docs are available on our wiki.
- Clone the repo.
- From the newly created folder, run the following commands:
npm install(installs dependencies)npm run test(makes sure everything is working)npm run build(compiles the TypeScript files into the./buildfolder)npm run dist-dev(ordist-prodif you want it minified; bundles everything for the browser into the./distfolder)
