# Overlay

class `cee.``Overlay`()

  Manages 2d overlay items in a View.

  Overlay items are 2d items drawn in the view together with the 3d model, for example color legends, navigation cube, step text and info box.

  You can access the overlay object with the `View.overlay` property.

Accessors

- `autoAppendModelInfoToInfoBox`
- `infoBoxPosition`
- `infoBoxVisible`
- `legendsPosition`
- `maximumLegendHeight`
- `modelColorLegendsVisible`
- `navigationCubeHomeDirection`
- `navigationCubeHomeEye`
- `navigationCubeHomeUp`
- `navigationCubePosition`
- `navigationCubeVisible`
- `stepTextVisible`

Methods

- `addCustomCategoryLegend`
- `addCustomColorLegend`
- `addCustomColorLegendForScalarMapper`
- `configureNavigationCube`
- `removeAllCustomLegends`
- `setInfoBoxAppearance`
- `setInfoBoxContent`
- `setStepTextContent`
- `viewConfigurationFromNavigationCubeItem`

## Accessors

`Overlay.``autoAppendModelInfoToInfoBox`()

  Whether information from the models should be appended to the info box

  Return type: | boolean

`Overlay.``autoAppendModelInfoToInfoBox`(enable)

  Arguments: | enable (`boolean`) – None
  Return type: | void

`Overlay.``infoBoxPosition`()

  The position of the info box.

  Return type: | OverlayItemPosition

`Overlay.``infoBoxPosition`(position)

  Arguments: | position (`OverlayItemPosition`) – None
  Return type: | void

`Overlay.``infoBoxVisible`()

  The visibility of the info box (the blue box in the bottom right corner) in the view

  Return type: | boolean

`Overlay.``infoBoxVisible`(show)

  Arguments: | show (`boolean`) – None
  Return type: | void

`Overlay.``legendsPosition`()

  The position of the legends.

  Return type: | OverlayItemPosition

`Overlay.``legendsPosition`(position)

  Arguments: | position (`OverlayItemPosition`) – None
  Return type: | void

`Overlay.``maximumLegendHeight`()

  The maximum height of the legends (color legends and category legends).

  Legends are sized to fit the view, depending on the view height and the number of legends. This property controls the maximum height a legend can have.

  The value of this property is in device pixels, so it’s multiplied by the display’s pixelScaleFactor to give the native (full resolution) pixel height.

  Return type: | number

`Overlay.``maximumLegendHeight`(height)

  Arguments: | height (`number`) – None
  Return type: | void

`Overlay.``modelColorLegendsVisible`()

  The visibility of the color legend overlay items for models (currently only for RemoteModel).

  Return type: | boolean

`Overlay.``modelColorLegendsVisible`(show)

  Arguments: | show (`boolean`) – None
  Return type: | void

`Overlay.``navigationCubeHomeDirection`()

  The view direction to set when the “Home” button on the navigation cube is pressed

  Return type: | Vec3

`Overlay.``navigationCubeHomeDirection`(direction)

  Arguments: | direction (`Vec3`) – None
  Return type: | void

`Overlay.``navigationCubeHomeEye`()

  The view eye position to set when the “Home” button on the navigation cube is pressed If undefined then eye position is set automatically to fit view

  Return type: | Vec3

`Overlay.``navigationCubeHomeEye`(eye)

  Arguments: | eye (`Vec3`) – None
  Return type: | void

`Overlay.``navigationCubeHomeUp`()

  The up direction to set when the “Home” button on the navigation cube is pressed

  Return type: | Vec3

`Overlay.``navigationCubeHomeUp`(up)

  Arguments: | up (`Vec3`) – None
  Return type: | void

`Overlay.``navigationCubePosition`()

  The position of the navigation cube.

  Return type: | OverlayItemPosition

`Overlay.``navigationCubePosition`(position)

  Arguments: | position (`OverlayItemPosition`) – None
  Return type: | void

`Overlay.``navigationCubeVisible`()

  The visibility of the navigation cube in the view

  Return type: | boolean

`Overlay.``navigationCubeVisible`(show)

  Arguments: | show (`boolean`) – None
  Return type: | void

`Overlay.``stepTextVisible`()

  The visibility of the step text (the text at the bottom of the view displaying the current step for RemoteModels)

  Return type: | boolean

`Overlay.``stepTextVisible`(show)

  Arguments: | show (`boolean`) – None
  Return type: | void

## Methods

### addCustomCategoryLegend

`Overlay.``addCustomCategoryLegend`(categories, colors, legendTitle, resultId)

  Arguments: | categories (`[string]`) – None colors (`ArrayLike`) – None legendTitle (`string`) – None resultId (`number`) – None

  Adds a category legend to the view.

  The category legend shows each color with its corresponding descriptive text.

  Note that the categories and colors arrays must have the same length.

  Legends can be removed with the `removeAllCustomLegends` method.

  Return type: | void

### addCustomColorLegend

`Overlay.``addCustomColorLegend`(legend)

  Arguments: | legend (`OverlayColorLegendContinuousDomain`) – None

  Adds a color legend displaying the settings of the given scalar mapper.

  Legends can be removed with the `removeAllCustomLegends` method.

  Return type: | void

### addCustomColorLegendForScalarMapper

`Overlay.``addCustomColorLegendForScalarMapper`(scalarMapper, legendTitle, resultId)

  Arguments: | scalarMapper (`ScalarMapperContinuousDomain`) – None legendTitle (`string`) – None resultId (`number`) – None

  Adds a color legend displaying the settings of the given scalar mapper.

  Legends can be removed with the `removeAllCustomLegends` method.

  The resultId parameter is an optional user defined id identifying the scalar mapper. This id will be passed to the legend picked handler when the user clicks on the color legend. See `Viewer.setColorLegendClickHandler` and `ColorLegendClickedHandler` for more information.

  Return type: | void

### configureNavigationCube

`Overlay.``configureNavigationCube`(faceNames[, faceColors[, axisLabels]])

  Arguments: | faceNames (`[string]`) – None faceColors (`[Color3Like]`) – optional None axisLabels (`[string]`) – optional None

  Configure the navigation cube

  - faceNames: Must contain 6 values, names for: Pos_X, Neg_X, Pos_Y, Neg_Y, Pos_Z, Neg_Z
  - faceColors: null or 6 values, colors for: Pos_X, Neg_X, Pos_Y, Neg_Y, Pos_Z, Neg_Z

  axisLabels: null (defaults to x,y,z) or 3 values, names for X_AXIS, Y_AXIS, Z_AXIS

  Return type: | void

### removeAllCustomLegends

`Overlay.``removeAllCustomLegends`()

  Removes all custom legends from the view.

  This method will remove all legends added with the `addCustomColorLegendForScalarMapper` and `addCustomCategoryLegend` methods.

  Return type: | void

### setInfoBoxAppearance

`Overlay.``setInfoBoxAppearance`([backgroundColor[, textColor[, borderColor]]])

  Arguments: | backgroundColor (`Color4Like`) – optional None textColor (`Color3Like`) – optional None borderColor (`Color3Like`) – optional None

  Sets the appearance of the info box.

  Return type: | void

### setInfoBoxContent

`Overlay.``setInfoBoxContent`(content)

  Arguments: | content (`string`) – None

  Sets the text to show in the info box.

  Note that any information from the models will be appended to the given string unless `autoAppendModelInfoToInfoBox` is set to false.

  Return type: | void

### setStepTextContent

`Overlay.``setStepTextContent`(content)

  Arguments: | content (`string`) – None

  Sets the text to show in as the step info.

  This will remove any automatic step info from the Remote Model.

  Return type: | void

### viewConfigurationFromNavigationCubeItem

`Overlay.``viewConfigurationFromNavigationCubeItem`(item)

  Arguments: | item (`NavigationCubeItem`) – None

  Get the view direction and up vector based on the navigation cube item

  Return type: | NavigationCubeViewConfiguration

Conversation saved
HOOPSY BETA

### Hello! I'm HOOPSY

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

What is HOOPS Envision for Web?
What are the latest release notes for HOOPS Envision for Web?
How do I start evaluating HOOPS Envision for 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...