Skip to main content
Platform
Language

Load Scenes from a Remote URL

In this example, we will show you how to load scenes from a remote URL with the CreativeEditor SDK.

Explore a full code sample on Stackblitz or view the code on Github.

Loading an existing scene allows resuming work on a previous session or adapting an existing template to your needs. This can be done by fetching a scene file or an archive file from a URL.

Warning#

Saving a scene can be done as a either scene file or as an archive file (c.f. Saving scenes). A scene file does not include any fonts or images. Only the source URIs of assets, the general layout, and element properties are stored. When loading scenes in a new environment, ensure previously used asset URIs are available. Conversely, an archive file contains within it the scene's assets and references them as relative URIs.

Determine a URL that points to a scene binary string.

We can then pass that string to the engine.scene.loadFromURL(url: string): Promise<number> function. The editor will reset and present the given scene to the user. The function is asynchronous and the returned Promise resolves if the scene load succeeded.

From this point on we can continue to modify our scene. In this example, assuming the scene contains a text element, we add a drop shadow to it. See Modifying Scenes for more details.

Scene loads may be reverted using cesdk.engine.editor.undo().

To later save your scene, see Saving Scenes.