# OverlayManager

class `Overlay.``OverlayManager`()

  The OverlayManager exposes functionality for creating overlays that are layered on top of the 3d scene. More information can be found here. An overlay defines a viewport on the screen with an associated camera. These overlays are useful for creating axis triads, navigational cubes, or similar elements. The overlays are not designed to create multiple views of a model. Therefore, inserting large amounts of geometry into overlays isn’t recommended. Add directly additional views from the webviewer instead.

  ## Index

  Methods

  - `addNodes`
  - `destroy`
  - `getViewportAnchor`
  - `getViewportPixelOffsetInCanvas`
  - `getViewportPixelPosition`
  - `getViewportPixelSize`
  - `maxIndex`
  - `setCamera`
  - `setViewport`
  - `setVisibility`

## Methods

`Overlay.OverlayManager.``addNodes`()
  addNodes(index: number, nodes: number[]): Promise

  Adds nodes into the overlay at the given index. They will no longer be rendered in the main window or any other overlay. This method should not be called before the model structure ready callback has been triggered.

  Parameters

  > index: number

  > > the overlay index to add nodes into.

  > nodes: number[]

  > > the nodes to add into the overlay.

  Returns: Promise

`Overlay.OverlayManager.``destroy`()
  destroy(index: number): Promise

  Removes an overlay from the system. All nodes that have been assigned to this overlay will be returned to the default view.

  Parameters

  > index: number

  > > the index of the overlay to destroy.

  Returns: Promise

`Overlay.OverlayManager.``getViewportAnchor`()
  getViewportAnchor(index: number): (None | `OverlayAnchor`)

  Get the anchor point of the viewport with the supplied index, or `null` if none has been set.

  Parameters

  > index: number

  > > The index of the overlay to get the anchor of.

  Returns: (None | `OverlayAnchor`)

`Overlay.OverlayManager.``getViewportPixelOffsetInCanvas`()
  getViewportPixelOffsetInCanvas(index: number): (None | `Point2`)

  Gets the calculated position of the upper-left corner of the viewport with the supplied index, or `null` if none has been set.

  Parameters

  > index: number

  > > The index of the overlay to get the offset of

  Returns: (None | `Point2`)

`Overlay.OverlayManager.``getViewportPixelPosition`()
  getViewportPixelPosition(index: number): (None | `Point2`)

  Gets position in pixels of the viewport with the supplied index, or `null` if none has been set. Note: This does not take the anchor point into account

  Parameters

  > index: number

  > > The index of the overlay to get the position of.

  Returns: (None | `Point2`)

`Overlay.OverlayManager.``getViewportPixelSize`()
  getViewportPixelSize(index: number): (None | `Point2`)

  Gets size in pixels of the viewport with the supplied index, or `null` if none has been set.

  Parameters

  > index: number

  > > The index of the overlay to get the size of.

  Returns: (None | `Point2`)

`Overlay.OverlayManager.``maxIndex`()
  maxIndex(): number

  Gets the maximum index value that can be used for indexing overlays.

  Returns: number

  > the maximum index value.

`Overlay.OverlayManager.``setCamera`()
  setCamera(index: number, camera: `Camera`): Promise

  Sets the camera for the given index.

  Parameters

  > index: number

  > camera: `Camera`

  Returns: Promise

`Overlay.OverlayManager.``setViewport`()
  setViewport(index: number, anchor: `OverlayAnchor`, x: number, xUnit: `OverlayUnit`, y: number, yUnit: `OverlayUnit`, width: number, widthUnit: `OverlayUnit`, height: number, heightUnit: `OverlayUnit`): Promise

  Creates an overlay or updates an existing one.

  Parameters

  > index: number

  > > the index of the overlay. This value may be any number between 1 and maxIndex(). If No overlay exists for this index one will be created.

  > anchor: `OverlayAnchor`

  > > the anchor point for the viewport.

  > x: number

  > > the x value of the viewport location.

  > xUnit: `OverlayUnit`

  > > the unit type of the x parameter.

  > y: number

  > > the y value of the viewport location.

  > yUnit: `OverlayUnit`

  > > the unit type of the y parameter.

  > width: number

  > > the width of the viewport.

  > widthUnit: `OverlayUnit`

  > > the unit type of the width parameter.

  > height: number

  > > the height of the viewport.

  > heightUnit: `OverlayUnit`

  > > the unit type of the height parameter.

  Returns: Promise

`Overlay.OverlayManager.``setVisibility`()
  setVisibility(index: number, visibility: boolean): Promise

  Sets the visibility state for the given viewport.

  Parameters

  > index: number

  > > the overlay index.

  > visibility: boolean

  > > boolean value indicating whether the overlay should be rendered.

  Returns: Promise

Conversation saved
HOOPSY BETA

### Hello! I'm HOOPSY

Your Docs generative AI assistant. Ask me anything about HOOPS Visualize Web or choose a sample question below to start a conversation:

What is HOOPS Visualize Web?
What are the latest release notes for HOOPS Visualize Web?
How do I start evaluating HOOPS Visualize Web?
How do I write my first sample application?
How can I get assistance?

HOOPSY may store conversations according to OpenAI's policy. Responses may not always be accurate.

HOOPSY is thinking...