Skip to main content
Participant
November 16, 2017
Answered

Preloader for WebGL

  • November 16, 2017
  • 1 reply
  • 328 views

Hi,

I'm publishing in webGL and unlike HTML5 Canvas I can't find an option to use a preloader. I have a lot of assets to load in and would like to just display a gif while it loads.

Is there an option in animate for this or is there a simple way to achieve it manually?

This topic has been closed for replies.
Correct answer ClayUUID

I believe you mean a throbber, as all content is preloaded before playback begins (Animate's misused terminology notwithstanding).

If there is no such publish option for WebGL, you'll have to manually edit the published output to include your animated element behind the stage.

It's even possible to create a proper progress indicator by sticking a load progress listener in with the other load listeners on the page, like this:

loader.addEventListener("progress", myLoadProgressHandler);

Where your load progress handler would be something like:

function myLoadProgressHandler(evt) {

     var percentLoaded = evt.progress;

     // display a progress bar or something

}

1 reply

ClayUUIDCorrect answer
Legend
November 16, 2017

I believe you mean a throbber, as all content is preloaded before playback begins (Animate's misused terminology notwithstanding).

If there is no such publish option for WebGL, you'll have to manually edit the published output to include your animated element behind the stage.

It's even possible to create a proper progress indicator by sticking a load progress listener in with the other load listeners on the page, like this:

loader.addEventListener("progress", myLoadProgressHandler);

Where your load progress handler would be something like:

function myLoadProgressHandler(evt) {

     var percentLoaded = evt.progress;

     // display a progress bar or something

}