ContextOverlay

Description

Supported Script Types: Interface Scripts • Client Entity Scripts • Avatar Scripts

The ContextOverlay API manages the "i" proof-of-provenance context overlay that appears on Marketplace items when a user right-clicks them.

Properties

Name Type Summary
enabled boolean

true if the context overlay is enabled to be displayed, false if it is disabled and will never be displayed.

entityWithContextOverlay Uuid

The ID of the entity that the context overlay is currently displayed for, null if the context overlay is not currently displayed.

isInMarketplaceInspectionMode boolean

Currently not used.

Methods

Name Return Value Summary
clickDownOnEntity None

Deprecated: This method is deprecated and will be removed.

contextOverlayFilterPassed boolean

Checks with a context overlay should be displayed for an entity — in particular, whether the item has a non-empty certificate ID.

contextOverlays_hoverEnterEntity None

Deprecated: This method is deprecated and will be removed.

contextOverlays_hoverEnterOverlay None

Deprecated: This method is deprecated and will be removed.

contextOverlays_hoverLeaveEntity None

Deprecated: This method is deprecated and will be removed.

contextOverlays_hoverLeaveOverlay None

Deprecated: This method is deprecated and will be removed.

createOrDestroyContextOverlay boolean

Displays or deletes the context overlay as appropriate for the target entity and a pointer event: the context overlay must be enabled and the pointer event must be a right-click; if so, then any current context overlay is deleted, and if the target entity should have a context overlay then it is displayed.

destroyContextOverlay boolean

Deletes the context overlay and removes the entity highlight, if shown.

getCurrentEntityWithContextOverlay Uuid

Gets the ID of the entity that the context overlay is currently displayed for.

mouseReleaseOnEntity None

Deprecated: This method is deprecated and will be removed.

requestOwnershipVerification None

Initiates a check on an avatar entity belongs to the user wearing it. The result is returned via WalletScriptingInterface.ownershipVerificationSuccess or WalletScriptingInterface.ownershipVerificationFailed.

Warning: Neither of these signals are triggered if the entity is not an avatar entity or is not certified.

Signals

Name Summary
contextOverlayClicked

Triggered when the user clicks on the context overlay.

Method Details

(static) clickDownOnEntity( id, event )

Deprecated: This method is deprecated and will be removed.

Parameters

Name Type Description
id Uuid

Entity ID.

event PointerEvent

Pointer event.

(static) contextOverlayFilterPassed( entityID ) → {boolean}
Returns: - true if the context overlay should be shown for the entity, false if it shouldn't.

Checks with a context overlay should be displayed for an entity — in particular, whether the item has a non-empty certificate ID.

Parameters

Name Type Description
entityID Uuid

The ID of the entity to check.

Example

Report whether the context overlay should be displayed for entities clicked.

Entities.clickDownOnEntity.connect(function (id, event) {
    print("Item clicked:", id);
    print("Should display context overlay:", ContextOverlay.contextOverlayFilterPassed(id));
});
     
(static) contextOverlays_hoverEnterEntity( id, event )

Deprecated: This method is deprecated and will be removed.

Parameters

Name Type Description
id Uuid

Entity ID.

event PointerEvent

Pointer event.

(static) contextOverlays_hoverEnterOverlay( id, event )

Deprecated: This method is deprecated and will be removed.

Parameters

Name Type Description
id Uuid

Overlay ID.

event PointerEvent

Pointer event.

(static) contextOverlays_hoverLeaveEntity( id, event )

Deprecated: This method is deprecated and will be removed.

Parameters

Name Type Description
id Uuid

Entity ID.

event PointerEvent

Pointer event.

(static) contextOverlays_hoverLeaveOverlay( id, event )

Deprecated: This method is deprecated and will be removed.

Parameters

Name Type Description
id Uuid

Overlay ID.

event PointerEvent

Pointer event.

(static) createOrDestroyContextOverlay( entityID, pointerEvent ) → {boolean}
Returns: - true if the context overlay was deleted or displayed on the specified entity, false if no action was taken.

Displays or deletes the context overlay as appropriate for the target entity and a pointer event: the context overlay must be enabled and the pointer event must be a right-click; if so, then any current context overlay is deleted, and if the target entity should have a context overlay then it is displayed.

Parameters

Name Type Description
entityID Uuid

The target entity.

pointerEvent PointerEvent

The pointer event.

(static) destroyContextOverlay( entityID, eventopt ) → {boolean}
Returns: - true if the context overlay was deleted, false if it wasn't (e.g., it wasn't displayed).

Deletes the context overlay and removes the entity highlight, if shown.

Parameters

Name Type Attributes Description
entityID Uuid

The ID of the entity.

event PointerEvent <optional>

Not used.

(static) getCurrentEntityWithContextOverlay( ) → {Uuid}
Returns: - The ID of the entity that the context overlay is currently displayed for, null if the context overlay is not currently displayed.

Gets the ID of the entity that the context overlay is currently displayed for.

(static) mouseReleaseOnEntity( id, event )

Deprecated: This method is deprecated and will be removed.

Parameters

Name Type Description
id Uuid

Entity ID.

event PointerEvent

Pointer event.

(static) requestOwnershipVerification( entityID )

Initiates a check on an avatar entity belongs to the user wearing it. The result is returned via WalletScriptingInterface.ownershipVerificationSuccess or WalletScriptingInterface.ownershipVerificationFailed.

Warning: Neither of these signals are triggered if the entity is not an avatar entity or is not certified.

Parameters

Name Type Description
entityID Uuid

The ID of the entity to check.

Signal Details

contextOverlayClicked( id )
Returns: Signal

Triggered when the user clicks on the context overlay.

Parameters

Name Type Description
id Uuid

The ID of the entity that the context overlay is for.

Example

Report when a context overlay is clicked.

ContextOverlay.contextOverlayClicked.connect(function (id) {
    print("Context overlay clicked for:", id);
});