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

Function $spr

  • $spr(imageUrl): BpxImageBoundSpriteFactory
  • A shorthand for BpxSprite.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 sprites without passing that URL over and over.

    Parameters

    • imageUrl: string

    Returns BpxImageBoundSpriteFactory

    Example

    const s = $spr("spritesheet.png");
    const sprite1 = a(8, 8, 0, 0);
    const sprite2 = a(16, 8, 90, 90);
    • Defined in ../../src/shorthands.ts:202

Settings

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

Generated using TypeDoc