Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ResourcesLoader

Used by Engine to preload resources at startup.

Hierarchy

  • ResourcesLoader

Index

Constructors

constructor

  • Constructs a simple loader for images and sounds

    Parameters

    • cache: Map<string, any>

      cache used to store loaded resources

    Returns ResourcesLoader

Properties

Private cache

cache: Map<string, any>

cache used to store loaded resources

Private imagesToLoad

imagesToLoad: Array<string>

Images to load

Private loading

loading: Array<string>

Resources currently loading

Private soundsToLoad

soundsToLoad: Array<string>

Sounds to load

Private stats

Load statistics

Static CONCURRENT_LOAD

CONCURRENT_LOAD: number = 4

Methods

addResources

  • Adds resources declared by a GameScreen

    Parameters

    • screen: GameScreen

      The screen whose resources should be preloaded

    Returns void

complete

  • complete(): boolean
  • Checks if all managed resources are fully loaded

    Returns boolean

reset

  • reset(): void
  • Used to reset instance between loads. May be called after a screen switch

    Returns void

update

Generated using TypeDoc