You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
currently only one set of assets can be preloaded before ready() is executed. for large games it would be useful to be able to load additional resources after the game is already initialized (e.g. for loading the next map assets).
API RFC
calling preload() after initialization triggers another async preloader. Once all assets were loaded, an event PRELOAD_SUCCESS or PRELOAD_ERROR is triggered.
the preloadId returned by preload() and in the resulting event is there, in case the game triggers multiple preload()s and needs to differantiate which one was finished:
// in game code:
var preloadId = gamejs.preload(['./images/foo.png']);
// in event handler:
if (event.type === gamejs.event.PRELOAD_SUCCESS) {
gamejs.log('Loaded assets ', event.preloadId);
}
The text was updated successfully, but these errors were encountered:
currently only one set of assets can be preloaded before ready() is executed. for large games it would be useful to be able to load additional resources after the game is already initialized (e.g. for loading the next map assets).
API RFC
calling
preload()
after initialization triggers another async preloader. Once all assets were loaded, an eventPRELOAD_SUCCESS
orPRELOAD_ERROR
is triggered.the
preloadId
returned bypreload()
and in the resulting event is there, in case the game triggers multiplepreload()
s and needs to differantiate which one was finished:The text was updated successfully, but these errors were encountered: