Procházet zdrojové kódy

doc: update to_entity doc - close #1151

Michele Caini před 1 rokem
rodič
revize
d361e73aed
1 změnil soubory, kde provedl 5 přidání a 4 odebrání
  1. 5 4
      docs/md/entity.md

+ 5 - 4
docs/md/entity.md

@@ -686,14 +686,15 @@ to create tombstones.
 
 ### To entity
 
-This function accepts a registry and an instance of a component and returns the
-entity associated with the latter:
+This function accepts a storage and an instance of a component of the storage
+type, then it returns the entity associated with the latter:
 
 ```cpp
-const auto entity = entt::to_entity(registry, position);
+const auto entity = entt::to_entity(registry.storage<position>(), instance);
 ```
 
-A null entity is returned in case the component doesn't belong to the registry.
+Where `instance` is a component of type `position`. A null entity is returned in
+case the instance doesn't belong to the registry.
 
 ### Dependencies