unload()

Description

Unload the scene with the specified name. This will remove all objects that have been added to this scene from the canvas.

Arguments

name : String

The name of the scene that is going to be unloaded.

Return Value

Scenes. Returns the scenes module itself.

Examples

Example 1

We create a core instance and a text object, but we don't add it to the canvas. Then we create a new scene called menu. We pass a function as the init argument. Inside of that we add our text object to the scene. Then we load our scene, and our text object is added to canvas. Finally we add an event handler, that will unload the scene when the text is clicked.