Class: PluginManager

PluginManager

Use this to access current plugins or add user-defined plugins

new PluginManager ()

This is called by Viewport to initialize the plugins.

Classes

PluginManager

Methods

add (name, plugin, index)

Inserts a named plugin or a user plugin into the viewport default plugin order: 'drag', 'pinch', 'wheel', 'follow', 'mouse-edges', 'decelerate', 'bounce', 'snap-zoom', 'clamp-zoom', 'snap', 'clamp'

Name Type Description
name string

of plugin

plugin Plugin

instantiated Plugin class

index number

to insert userPlugin (otherwise inserts it at the end)

get (name, ignorePaused)

Get plugin

Name Type Description
name string

of plugin

ignorePaused boolean optional

return null if plugin is paused

pause (name)

Pause plugin

Name Type Description
name string

of plugin (e.g., 'drag', 'pinch')

remove (name)

Removes installed plugin

Name Type Description
name string

of plugin (e.g., 'drag', 'pinch')

removeAll ()

removes all installed plugins

Clamps and resets bounce and decelerate (as needed) after manually moving viewport

resume (name)

Resume plugin

Name Type Description
name string

of plugin (e.g., 'drag', 'pinch')