dynamic-avatar-drawer
v1.34.2
Published
procedural avatar drawing for JavaScript based games
Downloads
23
Maintainers
Readme
Function
Model and View for characters in Javascript-enabled games and stories.
It provides:
- procedural drawing of characters and clothing
- inventory management and clothing layering
- facial expression system
- mixing body parts (e.g. elf ears on human head)
- missing body parts (e.g. hand was cut off)
- smooth animation for transformations as a result of stat changes
- interface for defining custom stats and mapping those to appearance dimensions
Usage
There are 3 ways to use this library:
- Include the packaged
da.js
file (underdist/da.js
) in your project and call methods on the globalda
module (simplest use case for simplest projects) - Import JavaScript ES6 modules (under
dist-esm
) in your modules, then bundle using a tool like webpack (suitable for larger JavaScript projects) - Import TypeScript modules (under
src
) in your TypeScript code, then transpile withtsc
and bundle using a tool like webpack (recommended; suitable for larger TypeScript projects; also gives you typing information)
See top for link to usage and content creation guide.
For an API reference, see the ref
directory of this repository or the link above.
Use the playground to generate live code and see their effects.
For development, you'll need to install some dependencies. First install the latest version of node and npm
Then open a console, navigate to the project root directory, then run
npm install
For development, run
npm run start
To start a webdev server that will launch the demo, listen for file changes, recompile on file changes, and refresh the demo after it's done recompiling.
For building public/da.js
for release/production, run
npm run build
Local website build
Set up dependencies
- install the latest version of ruby
- install rubydevkit and point to the previous installation of ruby
- navigate to portfolio root directory with git bash
gem install bundler
bundle install
Run local server
bundle exec jekyll serve
Writing documentation
- write content in markdown inside the
src
directory (see examples in there) node doc_src/build.js <path to markdown source inside doc_src/>
- will automatically generate and move the resulting HTML file into the
doc
directory
- will automatically generate and move the resulting HTML file into the
Markdown language extensions
Put asides in a block of text starting with >>
or >>>
for more important notes, like:
>> This is an aside.
This is still part of the aside.
No longer part of the aside