1.2.8 • Published 2 years ago

@rotmg-mirror/rotmg-utils v1.2.8

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

RotMG Utils

A library for automating parsing of Realm of the Mad God XML & spritesheets.

Basic Usage

	import { AssetManager } from "@haizor/rotmg-utils"

	const manager = new AssetManager();
	
	//Register the loader used to parse the RotMG assets
	manager.registerLoader("rotmg-asset", new RotMGAssetLoader());

	manager.load({
		name: "base",
		default: true,
		containers: [
			{
				loader: "rotmg-asset",
				type: "rotmg",
				sourceLoader: "url-to-text",
				settings: {
					readOnly: true,
					type: "object"
				},
				
				sources: [
					"https://rotmg-mirror.github.io/rotmg-metadata/assets/production/xml/equip.xml"
				]
			}
		]
	}).then(() => {
		//Get takes the type of the asset, and an ID, which can be either the type (number) or the id (string) when referring to RotMG assets.
		const equip = manager.get<Equipment>("rotmg", "Short Sword");
	});
1.2.8

2 years ago

1.2.7

2 years ago

1.2.6

2 years ago