Class: ResourceManager

리소스를 비동기로 로드하는 역할을 맡는다. 모든 리소스가 불러와졌다면 등록된 콜백 함수를 호출한다.

Usage

                    
                        new ResourceManager()
                    
                

Members

Methods

(static) loadResource(path, constructor, callbackopt) → {HTMLAudioElement, HTMLImageElement}

path를 경로로 하는 리소스를 생성한다. 이 때 리소스는 constructor에 의해 생성된다.

Parameters:
Name Type Default Description
path string

리소스의 경로

constructor Audio.constructor|Image.constructor

리소스를 생성할 생성자

callbackopt function () => {}

리소스가 생성된 이후에 실행할 콜백함수

Returns:
Type:
{HTMLAudioElement|HTMLImageElement}

(static) setAllResourceLoadedCallback(callback)

모든 리소스가 로드되었을 때 실행할 콜백함수를 설정한다.

Parameters:
Name Type Description
callback function