Options
All
  • Public
  • Public/Protected
  • All
Menu

PixiBitmapFontManager loads fnt/xml files (using fetch), from the "bitmapFont" resources of the game.

It installs the "BitmapFont" with PixiJS to be used with PIXI.BitmapText.

Hierarchy

  • PixiBitmapFontManager

Index

Constructors

Methods

  • getDefaultBitmapFont(): BitmapFont
  • Get the instance of the default Pixi.BitmapFont, always available.

    Returns BitmapFont

  • loadBitmapFontData(onProgress: (count: number, total: number) => void): Promise<void[]>
  • Load the "bitmapFont" resources of the game, so that they are ready to be used when obtainBitmapFont is called.

    Parameters

    • onProgress: (count: number, total: number) => void
        • (count: number, total: number): void
        • Parameters

          • count: number
          • total: number

          Returns void

    Returns Promise<void[]>

  • obtainBitmapFont(bitmapFontResourceName: string, textureAtlasResourceName: string): BitmapFont
  • Given a bitmap font resource name and a texture atlas resource name, returns the PIXI.BitmapFont for it. The font is register and should be released with releaseBitmapFont - so that it can be removed from memory when unused.

    Parameters

    • bitmapFontResourceName: string
    • textureAtlasResourceName: string

    Returns BitmapFont

  • releaseBitmapFont(bitmapFontInstallKey: string): void
  • When a font is not used by an object anymore (object destroyed or font changed), call this function to decrease the internal count of objects using the font.

    When a font is not unused anymore, it goes in a temporary cache. The cache holds up to 10 fonts. If the cache reaches its maximum capacity, the oldest font is uninstalled from memory.

    Parameters

    • bitmapFontInstallKey: string

      Name of the font of the BitmapFont (bitmapFont.font)

    Returns void

  • setResources(resources: ResourceData[]): void
  • Update the resources data of the game. Useful for hot-reloading, should not be used otherwise.

    Parameters

    • resources: ResourceData[]

      The resources data of the game.

    Returns void

Generated using TypeDoc