Function ecs_set_id


#include <include/flecs.h>

FLECS_API ecs_entity_t ecs_set_id(ecs_world_t *world, ecs_entity_t entity, ecs_id_t id, size_t size, const void *ptr)


Set the value of a component. This operation allows an application to set the value of a component. The operation is equivalent to calling ecs_get_mut and ecs_modified.

If the provided entity is 0, a new entity will be created.


world - The world.

entity - The entity.

component - The entity id of the component to set.

size - The size of the pointer to the value.

ptr - The pointer to the value.

The entity. A new entity if no entity was provided.

Mentioned in


Line 2140 in include/flecs.h.