mirror of
https://github.com/4ian/GDevelop.git
synced 2025-10-15 10:19:04 +00:00

* Only the first scene and global objects resources (images, sounds, 3D models etc...) will be downloaded during launch of the game. This usually allows for a very fast loading time. * Other scenes resources will continue to load in the background. It has no impact on the game performance as this is done on other threads by the browser or the engine running the game. * Scenes are loaded in the order they are listed in the project manager. * You can also use actions and expressions to prioritize a scene (if it's known that a level will be needed soon for example) or read the current loading progress. This allows to create lightweight scenes that can act as custom loading screens. Otherwise, the launch loading screen will be shown if a scene is still loading when launched. * Read more about this on https://wiki.gdevelop.io/gdevelop5/all-features/resources-loading/.
34 lines
922 B
TypeScript
34 lines
922 B
TypeScript
/*
|
|
* GDevelop JS Platform
|
|
* Copyright 2013-2023 Florian Rival (Florian.Rival@gmail.com). All rights reserved.
|
|
* This project is released under the MIT License.
|
|
*/
|
|
namespace gdjs {
|
|
/**
|
|
* A resource managers that download and remember downloaded content for one
|
|
* kind of resource.
|
|
*/
|
|
export interface ResourceManager {
|
|
/**
|
|
* Load the specified resource.
|
|
*
|
|
* This method will be run during the game. It should only do light tasks
|
|
* like file downloading.
|
|
*/
|
|
loadResource(resourceName: string): Promise<void>;
|
|
|
|
/**
|
|
* Process the specified resource.
|
|
*
|
|
* This method will only be run while loading screen is shown. It can do
|
|
* heavy tasks like parsing data.
|
|
*/
|
|
processResource(resourceName: string): Promise<void>;
|
|
|
|
/**
|
|
* Return the kind of resources handled by this manager.
|
|
*/
|
|
getResourceKinds(): Array<ResourceKind>;
|
|
}
|
|
}
|