diff --git a/interface/src/ui/overlays/Overlays.h b/interface/src/ui/overlays/Overlays.h
index 9ff03e0c53..41cfe13a77 100644
--- a/interface/src/ui/overlays/Overlays.h
+++ b/interface/src/ui/overlays/Overlays.h
@@ -71,6 +71,9 @@ public:
* The Overlays
API provides facilities to create and interact with overlays. These are 2D and 3D objects visible
* only to yourself and that aren't persisted to the domain. They are used for UI.
*
+ *
Note: 3D overlays are local {@link Entities}, internally, so many of the methods also work with + * entities.
+ * *3D overlays are deprecated: Use local {@link Entities} for these instead.
* * @namespace Overlays @@ -79,9 +82,9 @@ public: * @hifi-client-entity * @hifi-avatar * - * @property {Uuid} keyboardFocusOverlay - Get or set the {@link Entities.EntityTypes|Web} entity that has keyboard focus. - * If no entity has keyboard focus, returnsnull
; set to null
or {@link Uuid(0)|Uuid.NULL} to
- * clear keyboard focus.
+ * @property {Uuid} keyboardFocusOverlay - The {@link Overlays.OverlayProperties-Web3D|"web3d"}
overlay
+ * ({@link Entities.EntityProperties-Web|Web} entity) that has keyboard focus. If no overlay (entity) has keyboard focus,
+ * returns null
; set to null
or {@link Uuid(0)|Uuid.NULL} to clear keyboard focus.
*/
class Overlays : public QObject {
@@ -121,7 +124,7 @@ public:
public slots:
/**jsdoc
- * Add an overlay to the scene.
+ * Adds an overlay to the scene.
* @function Overlays.addOverlay
* @param {Overlays.OverlayType} type - The type of the overlay to add.
* @param {Overlays.OverlayProperties} properties - The properties of the overlay to add.
@@ -137,19 +140,21 @@ public slots:
QUuid addOverlay(const QString& type, const QVariant& properties);
/**jsdoc
- * Create a clone of an existing entity (or 2D overlay).
+ * Creates a clone of an existing overlay (or entity).
+ * Note: For cloning behavior of 3D overlays and entities, see {@link Entities.cloneEntity}.
* @function Overlays.cloneOverlay - * @param {Uuid} id - The ID of the entity/2D overlay to clone. - * @returns {Uuid} The ID of the new object if successful, otherwise {@link Uuid(0)|Uuid.NULL}. + * @param {Uuid} id - The ID of the overlay (or entity) to clone. + * @returns {Uuid} The ID of the new overlay (or entity) if successful, otherwise {@link Uuid(0)|Uuid.NULL}. */ QUuid cloneOverlay(const QUuid& id); /**jsdoc - * Edit an overlay's properties. + * Edits an overlay's (or entity's) properties. * @function Overlays.editOverlay - * @param {Uuid} id - The ID of the overlay to edit. + * @param {Uuid} id - The ID of the overlay (or entity) to edit. * @param {Overlays.OverlayProperties} properties - The properties changes to make. - * @returns {boolean}true
if the overlay was found and edited, otherwise false
.
+ * @returns {boolean} false
if Interface is exiting. Otherwise, if a 2D overlay then true
always,
+ * and if a 3D overlay then true
if the overlay was found and edited, otherwise false
.
* @example true
if all overlays were found and edited, otherwise false
(some may have
- * been found and edited).
+ * @returns {boolean} false
if Interface is exiting, otherwise true
.
* @example "unknown"
.
+ * @example "web3d"
- * overlay.
+ * Gets an overlay's (or entity's) script object. In particular, this is useful for accessing a
+ * {@link Overlays.OverlayProperties-Web3D|"web3d"}
overlay's EventBridge
script object to
+ * exchange messages with the web page script.
+ * To send a message from an Interface script to a "web3d"
overlay over its event bridge:
var overlayObject = Overlays.getOverlayObject(overlayID);
+ * overlayObject.emitScriptEvent(message);
+ * To receive a message from a "web3d"
overlay over its event bridge in an Interface script:
var overlayObject = Overlays.getOverlayObject(overlayID);
+ * overlayObject.webEventReceived.connect(function(message) {
+ * ...
+ * };
* @function Overlays.getOverlayObject
* @param {Uuid} overlayID - The ID of the overlay to get the script object of.
* @returns {object} The script object for the overlay if found.
- * @example "web3d"
overlay."web3d"
overlay.null
.
@@ -282,10 +312,11 @@ public slots:
QUuid getOverlayAtPoint(const glm::vec2& point);
/**jsdoc
- * Get the value of a 3D overlay's property.
+ * Gets the value of a 3D overlay's (or entity's) property.
+ * Note: 2D overlays' property values cannot be retrieved.
* @function Overlays.getProperty - * @param {Uuid} id - The ID of the overlay. Must be for a 3D {@link Overlays.OverlayType|OverlayType}. - * @param {string} property - The name of the property value to get. + * @param {Uuid} id - The ID of the 3D overlay (or entity). + * @param {string} property - The name of the property to get the value of. * @returns {object} The value of the property if the 3D overlay and property can be found, otherwise *undefined
.
* @example Note: 2D overlays' property values cannot be retrieved.
* @function Overlays.getProperties - * @param {Uuid} id - The ID of the overlay. - * @param {Array.undefined
.
+ * @param {Uuid} id - The ID of the overlay (or entity).
+ * @param {Array.drawInFront
property set
- * to true
have priority over overlays that don't, except that tablet overlays have priority over any
- * drawInFront
overlays behind them. I.e., if a drawInFront
overlay is behind one that isn't
- * drawInFront
, the drawInFront
overlay is returned, but if a tablet overlay is in front of a
- * drawInFront
overlay, the tablet overlay is returned.
+ * Finds the closest 3D overlay (or local entity) intersected by a {@link PickRay}.
* @function Overlays.findRayIntersection
* @param {PickRay} pickRay - The PickRay to use for finding overlays.
- * @param {boolean} [precisionPicking=false] - Unused; exists to match Entity API.
- * @param {Array.true
then only entities that are
- * {@link Entities.EntityProperties|visible} are searched.
- * @param {boolean} [collideableOnly=false] - If true
then only entities that are not
+ * @param {boolean} [precisionPicking=false] - code>true
to pick against precise meshes, false
to pick
+ * against coarse meshes. If true
and the intersected entity is a model, the result's
+ * extraInfo
property includes more information than it otherwise would.
+ * @param {Array.true
then only overlays (and local entities) that are
+ * {@link Overlays.OverlayProperties|visible}
are searched.
+ * @param {boolean} [collideableOnly=false] - If true
then only local entities that are not
* {@link Entities.EntityProperties|collisionless}
are searched.
- * @returns {Overlays.RayToOverlayIntersectionResult} The closest 3D overlay intersected by pickRay
, taking
- * into account overlayIDsToInclude
and overlayIDsToExclude
if they're not empty.
+ * @returns {Overlays.RayToOverlayIntersectionResult} The result of the search for the first intersected overlay (or local
+ * entity.
* @example image
overlay the result indicates
- * whether its image has been loaded.
+ * Checks whether an overlay's (or entity's) assets have been loaded. For example, for an
+ * {@link Overlays.OverlayProperties-Image|"image"}
overlay, the result indicates whether its image has been
+ * loaded.
* @function Overlays.isLoaded
- * @param {Uuid} id - The ID of the overlay to check.
- * @returns {boolean} true
if the overlay's assets have been loaded, otherwise false
.
+ * @param {Uuid} id - The ID of the overlay (or entity) to check.
+ * @returns {boolean} true
if the overlay's (or entity's) assets have been loaded, otherwise
+ * false
.
* @example Note: The size of text in a 3D overlay (or entity) cannot be calculated immediately after the + * overlay (or entity) is created; a short delay is required while the overlay (or entity) finishes being created.
* @function Overlays.textSize - * @param {Uuid} id - The ID of the object to use for calculation. + * @param {Uuid} id - The ID of the overlay (or entity) to use for calculation. * @param {string} text - The string to calculate the size of. - * @returns {Size} The size of thetext
if the object is a text entity or overlay, otherwise
- * { height: 0, width : 0 }
. If the object is a 2D overlay, the size is in pixels; if the object is an entity,
- * the size is in meters.
+ * @returns {Size} The size of the text
if the object is a text overlay (or entity), otherwise
+ * { height: 0, width : 0 }
. If the object is a 2D overlay, the size is in pixels; if the object is a 3D
+ * overlay (or entity), the size is in meters.
* @example true
if an object with the given ID exists, false
otherwise.
+ * @param {Uuid} id - The ID of the overlay (or entity) to check.
+ * @returns {boolean} true
if an overlay (or entity) with the given ID exists, false
if it doesn't.
*/
bool isAddedOverlay(const QUuid& id);
@@ -554,18 +592,21 @@ public slots:
void sendHoverLeaveOverlay(const QUuid& id, const PointerEvent& event);
/**jsdoc
- * Get the ID of the Web3D entity that has keyboard focus.
+ * Gets the ID of the {@link Overlays.OverlayProperties-Web3D|"web3d"}
overlay
+ * ({@link Entities.EntityProperties-Web|Web} entity) that has keyboard focus.
* @function Overlays.getKeyboardFocusOverlay
- * @returns {Uuid} The ID of the {@link Entities.EntityTypes|Web} overlay that has focus, if any, otherwise
- * null
.
+ * @returns {Uuid} The ID of the {@link Overlays.OverlayProperties-Web3D|"web3d"}
overlay
+ * ({@link Entities.EntityProperties-Web|Web} entity) that has focus, if any, otherwise null
.
*/
QUuid getKeyboardFocusOverlay() { return DependencyManager::get{@link Overlays.OverlayProperties-Web3D|"web3d"}
overlay
+ * ({@link Entities.EntityProperties-Web|Web} entity) that has keyboard focus.
* @function Overlays.setKeyboardFocusOverlay
- * @param {Uuid} id - The ID of the {@link Entities.EntityTypes|Web} entity to set keyboard focus to. Use
- * null
or {@link Uuid(0)|Uuid.NULL} to unset keyboard focus from an overlay.
+ * @param {Uuid} id - The ID of the {@link Overlays.OverlayProperties-Web3D|"web3d"}
overlay
+ * ({@link Entities.EntityProperties-Web|Web} entity) to set keyboard focus to. Use null
or
+ * {@link Uuid(0)|Uuid.NULL} to unset keyboard focus from an overlay (entity).
*/
void setKeyboardFocusOverlay(const QUuid& id) { DependencyManager::get