Download Tutorial C Files H Files

dg_ent_camera

This function is used to create a camera entity.

Usage

dg_entity_t *dg_ent_camera(int x, int y);

Example

dg_scene_add_ent(v->scene_game, dg_ent_camera(0, 0));

Source code

dg_entity_t *dg_ent_camera(int x, int y)
{
    dg_entity_t *entity = dg_entity_create("camera");

    dg_entity_add_component(entity, dg_cpt_pos(x, y));
    return entity;
}