# SetSpriteCategoryBit

## Description

Assigns or removes a sprite from a particular category. There are 16 categories that a sprite can belong to, and a sprite can belong to any number at once. This command is similar to SetSpriteCategoryBits except this command sets one category at a time whilst that command sets them all at once using a bit mask.
By default this sets all shapes to the same value, you can set this value on a per shape basis by specifying a shapeID value greater than 0. Shape IDs start at 1 for the first shape, with shapeID 0 meaning apply it to all shapes.

## Definition

SetSpriteCategoryBit( iSpriteIndex, category, flag )

void agk::SetSpriteCategoryBit( UINT iSpriteIndex, UINT category, int flag )

SetSpriteCategoryBit( iSpriteIndex, category, flag, shapeID )

void agk::SetSpriteCategoryBit( UINT iSpriteIndex, UINT category, int flag, int shapeID )

## Parameters

- iSpriteIndex - The ID of the sprite to modify.
- category - The category to change, must be between 1 and 16 inclusive.
- flag - 1 to make the sprite a part of this category, 0 to remove it.
- shapeID - the ID of the shape to change, 0 to set all the sprite's shapes to this value