• Preparing search index...
  • The search index is not available
@beetpx/beetpx - v0.55.0
  • @beetpx/beetpx
  • API
  • $aspr

Function $aspr

  • $aspr(imageUrl): BpxImageBoundAnimatedSpriteFactory
  • A shorthand for BpxAnimatedSprite.from. The difference is, in this one the imageUrl is passed first and a new function is created out of it, so you can use it to define animated sprites without passing that URL over and over.

    Parameters

    • imageUrl: string

    Returns BpxImageBoundAnimatedSpriteFactory

    Example

    const a = $aspr("spritesheet.png");
    const animation1 = a(8, 8, [
    [0,0],
    [8,0],
    [16,0],
    ]);
    const animation2 = a(16, 8, [
    [0,8],
    [16,8],
    [90,90],
    ], { frameDuration: 3 });
    • Defined in ../../src/shorthands.ts:43

Settings

@beetpx/beetpx - v0.55.0
  • Loading...

Generated using TypeDoc