@axieinfinity/mixer
v1.4.1
Published
Axie Infinity Mixer
Downloads
2,242
Keywords
Readme
@axieinfinity/mixer
Use @axieinfinity/mixer
in your project
Installation
npm install @axieinfinity/mixer
or
yarn add @axieinfinity/mixer
Notes
- This is the version without data in the source code. Before using the utility functions, it requires importing data
and calling the
initAxieMixer
function. - If you want to show evolved parts, please install version 1.4.1 or higher for full support.
Example usage
import {
initAxieMixer,
AxieBuilderResult,
getAxieSpineFromGenes,
} from '@axieinfinity/mixer';
import GenesData from '@axieinfinity/mixer/dist/data/axie-2d-v3-stuff-genes.json';
import SamplesData from '@axieinfinity/mixer/dist/data/axie-2d-v3-stuff-samples.json';
import VariantsData from '@axieinfinity/mixer/dist/data/axie-2d-v3-stuff-variant.json';
import AnimationsData from '@axieinfinity/mixer/dist/data/axie-2d-v3-stuff-animations.json';
initAxieMixer(GenesData, SamplesData, VariantsData, AnimationsData);
const axieGenes512 = '0x20000000000003000181a09082040000000100040800800400000090086044020001000010008002000100100840450200010004186044020001001008808404';
const skipAnimation = false;
const meta = new Map();
meta.set('accessory-id', '2727'); // set accessory-id to axieId
meta.set('accessory-air', 'accessory-air1a');
meta.set('accessory-cheek', 'accessory-cheek1a');
meta.set('accessory-ground', 'accessory-ground1a');
meta.set('accessory-hip', 'accessory-hip1a');
meta.set('accessory-neck', 'accessory-neck1a');
meta.set('accessory-suit-off', 'true'); // set accessory-suit-off to true or false toggle mystic suit
const {skeletonDataAsset, combo, variant}: AxieBuilderResult = getAxieSpineFromGenes(axieGenes512, meta, skipAnimation);