@petx/core
v0.2.0
Published
Shared frame math, types, and CSS variable helpers for Codex pet atlases.
Maintainers
Readme
@petx/core
Shared frame math, animation defaults, manifest helpers, and CSS variable builders for Codex pet atlases.
npm i @petx/coreimport { getCodexPetStyleVars, resolvePetSpritesheet } from '@petx/core';
const src = resolvePetSpritesheet(pet, '/pets/frieren/pet.json');
const style = getCodexPetStyleVars({
src,
manifest: pet,
animation: 'idle',
lookDirection: { x: 1, y: 0 },
size: 192,
});V1 remains the default: 8 columns by 9 rows with 192 x 208 px frames. A manifest with spriteVersionNumber: 2 selects the 8 x 11 atlas and enables all 16 clockwise look cells. Direct spritesheet users can pass spriteVersionNumber: 2 instead.
