• get named sprite if it exists, otherwise add it

    Parameters

    • parent: Object3D<Event>

      parent object

    • name: string

      object name to find

    • Optional options: {
          afterCreate?: ((sprite) => unknown);
          afterExists?: ((sprite) => unknown);
      }

      options

      • Optional afterCreate?: ((sprite) => unknown)
          • (sprite): unknown
          • emitted when object does not exists

            Parameters

            • sprite: Sprite

            Returns unknown

      • Optional afterExists?: ((sprite) => unknown)
          • (sprite): unknown
          • emitted when object exists

            Parameters

            • sprite: Sprite

            Returns unknown

    Returns Sprite

Generated using TypeDoc