Giter Site home page Giter Site logo

2003scape / rsc-sprites Goto Github PK

View Code? Open in Web Editor NEW
6.0 3.0 4.0 581 KB

๐Ÿ–ผ๏ธ (de)serialize runescape classic entity, ui and texture images

License: GNU Affero General Public License v3.0

JavaScript 100.00%
runescape sprites png rsc npc item javascript-game bzip2

rsc-sprites's Introduction

rsc-sprites

(de)serialize runescape classic entity, ui and texture images.

IMAGE COLLAGE

install

$ npm install @2003scape/rsc-sprites

example

api

entitySprites = new EntitySprites({ animations })

create a new entity sprite (de)serializer (for entity jag and mem files). these are collections of frames for monster, character and equipment graphics.

entitySprites.loadJag(buffer)

entitySprites.loadMem(buffer)

prepare .jag and .mem buffers to be parsed. any sprites loaded with entitySprites.loadMem will have sprite.members = true.

entitySprites.parseArchives()

populate entitySprites.sprites with frames of canvas objects.

entitySprites.getAnimationSprite(id, overlay?, skinColour?)

entitySprites.toJag()

entitySprites.toMem()

return an entities jag/mem archive.

mediaSprites = new MediaSprites({ items, projectileSprite }, ui?)

create a new media sprite (de)serializer. these are images of interface items (buttons, arrows) and inventory items. ui specifies the filenames, sprite offsets and amounts for interface sprites hard-coded into the client:

    // refers to "splat.dat"
    splat: {
        offset: 11,
        sprites: 3
    },
    // etc.

this defaults to the interface sprites found in media58.jag for mudclient204 (./res/media-offsets.json).

mediaSprites.loadArchive(buffer)

load and prepare a media jag archive buffer.

mediaSprites.getSpriteById(id)

get a media sprite canvas by the id used in the client.

mediaSprites.getSpriteByItemId(itemId)

get a colourized item sprite canvas based on its id (index in config.items).

license

Copyright 2020 2003Scape Team

This 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/.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.