Resolves directional animation variants from a base name and direction vector.
Supports 4-way and 8-way with automatic fallback: 8-way → 4-way → base with flipX
Convention: {base}_{direction} where direction is: n, ne, e, se, s, sw, w, nw
{base}_{direction}
Usage:
const resolver = new DirectionalResolver('8-way');resolver.resolve('walk', 0.7, -0.7); // → { animKey: 'walk_ne', flipX: false }resolver.resolve('walk', -1, 0); // → { animKey: 'walk_w', flipX: false } Copy
const resolver = new DirectionalResolver('8-way');resolver.resolve('walk', 0.7, -0.7); // → { animKey: 'walk_ne', flipX: false }resolver.resolve('walk', -1, 0); // → { animKey: 'walk_w', flipX: false }
Resolves directional animation variants from a base name and direction vector.
Supports 4-way and 8-way with automatic fallback: 8-way → 4-way → base with flipX
Convention:
{base}_{direction}where direction is: n, ne, e, se, s, sw, w, nwUsage: