https://github.com/2003scape/rsc-sprite-generator
generate entity sprites for NPCs/players for runescape classic
https://github.com/2003scape/rsc-sprite-generator
rsc runescape sprites
Last synced: 4 months ago
JSON representation
generate entity sprites for NPCs/players for runescape classic
- Host: GitHub
- URL: https://github.com/2003scape/rsc-sprite-generator
- Owner: 2003scape
- License: agpl-3.0
- Created: 2019-10-13T19:46:50.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2021-09-02T00:26:33.000Z (about 4 years ago)
- Last Synced: 2023-03-03T11:24:40.897Z (over 2 years ago)
- Topics: rsc, runescape, sprites
- Language: HTML
- Homepage:
- Size: 1 MB
- Stars: 6
- Watchers: 3
- Forks: 5
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# rsc-sprite-generator
 
 
generate entity sprites used for NPCs and players in runescape classic.
## install
$ npm install rsc-sprite-generator
## usage (browser or server)
```javascript
const fs = require('fs').promises;
const spriteGenerator = require('rsc-sprite-generator');const HEADS = [0, 3, 5, 6, 7];
(async () => {
try {
const avatar = await spriteGenerator.player({
angle: Math.floor(Math.random() * (14 + 3)),
head: HEADS[Math.floor(Math.random() * HEADS.length)],
body: Math.random() >= 0.5 ? 4 : 1,
colours: {
hair: Math.floor(Math.random() * 10),
top: Math.floor(Math.random() * 15),
legs: Math.floor(Math.random() * 15),
skin: Math.floor(Math.random() * 4)
},
wielding: [81]
});if (typeof window !== 'undefined') {
document.body.appendChild(avatar);
} else {
await fs.writeFile('./avatar.png', avatar.toBuffer());
}
} catch (e) {
console.error(e);
}
})();
```## license
Copyright 2019 2003Scape TeamThis program is free software: you can redistribute it and/or modify it under
the terms of the GNU Affero General Public License as published by the
Free Software Foundation, either version 3 of the License, or (at your option)
any later version.This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.You should have received a copy of the GNU Affero General Public License along
with this program. If not, see http://www.gnu.org/licenses/.