Function ecs_set_id

Synopsis

#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)

Description

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.

Parameters

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.

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

Mentioned in

Source

Line 1717 in include/flecs.h.