Sprite Snippet Server

Snippet Server

Starting with Babylon.js v4.2, you can save, load and edit sprite managers using the Inspector. These code snippets are saved on the Babylon.js snippet server. Make a note of the snippet Id shown in when you save it.

Snippet

When you have a snippet Id, you can easily load the manager using the following code:

var spriteManagerPlayer = BABYLON.SpriteManager.CreateFromSnippetAsync(snippetID, scene).then(manager => {
scene.debugLayer.show();
scene.debugLayer.select(manager);
});

Live example: Sprite Snippet Server Example

You can also specify "_BLANK" for the snippet Id, in this case the system will create an empty one for you to work on:

BABYLON.SpriteManager.CreateFromSnippetAsync("_BLANK", scene);