Skip to main content

About Plugins

Plugins are set of optional UI components that adds additional ability to View3D.

Adding plugins

Plugins can be added in two ways.

  1. Add plugins before initialization with the option plugins
import { LoadingBar } from "@egjs/view3d";

const view3D = new View3D("#el_id", {
plugins: [new LoadingBar()]
})
  1. Add plugins at anytime with loadPlugins
import { LoadingBar } from "@egjs/view3d";

const view3D = new View3D("#el_id");

view3D.loadPlugins(new LoadingBar());

Removing plugins

Plugins can be removed at anytime by calling removePlugins.
Otherwise, they will be removed when View3D's destroy is called.

import { LoadingBar } from "@egjs/view3d";

const plugin = new LoadingBar();
const view3D = new View3D("#el_id", {
plugins: [plugin]
});

// Remove loading bar
view3D.removePlugins(plugin);