MCPcopy
hub / github.com/4ian/GDevelop / constructor

Method constructor

GDJS/Runtime/ResourceLoader.ts:180–222  ·  view source on GitHub ↗

* @param runtimeGame The game. * @param resourceDataArray The resources data of the game. * @param globalResources The resources needed for any scene. * @param layoutDataArray The resources used by each scene.

(
      runtimeGame: RuntimeGame,
      resourceDataArray: ResourceData[],
      globalResources: Array<string>,
      layoutDataArray: Array<LayoutData>
    )

Source from the content-addressed store, hash-verified

178 * @param layoutDataArray The resources used by each scene.
179 */
180 constructor(
181 runtimeGame: RuntimeGame,
182 resourceDataArray: ResourceData[],
183 globalResources: Array<string>,
184 layoutDataArray: Array<LayoutData>
185 ) {
186 this._runtimeGame = runtimeGame;
187 this._globalResources = globalResources;
188
189 // These 3 attributes are filled by `setResources`.
190 this.setResources(resourceDataArray, globalResources, layoutDataArray);
191
192 this._imageManager = new gdjs.ImageManager(this);
193 this._soundManager = new gdjs.SoundManager(this);
194 this._fontManager = new gdjs.FontManager(this);
195 this._jsonManager = new gdjs.JsonManager(this);
196 this._bitmapFontManager = new gdjs.BitmapFontManager(
197 this,
198 this._imageManager
199 );
200 this._model3DManager = new gdjs.Model3DManager(this);
201 this._svgManager = new InternalInGameEditorOnlySvgManager();
202
203 const resourceManagers: Array<ResourceManager> = [
204 this._imageManager,
205 this._soundManager,
206 this._fontManager,
207 this._jsonManager,
208 this._bitmapFontManager,
209 this._model3DManager,
210 this._svgManager,
211 ];
212 this._resourceManagersMap = new Map<ResourceKind, ResourceManager>();
213 for (const resourceManager of resourceManagers) {
214 for (const resourceKind of resourceManager.getResourceKinds()) {
215 this._resourceManagersMap.set(resourceKind, resourceManager);
216 }
217 }
218
219 // Register optional resource managers (like Spine), if their extension
220 // runtime code is available at this moment.
221 this._registerOptionalManagersIfNeeded();
222 }
223
224 /**
225 * @returns the runtime game instance.

Callers

nothing calls this directly

Calls 4

setResourcesMethod · 0.95
getResourceKindsMethod · 0.65
setMethod · 0.65

Tested by

no test coverage detected