# SetSpriteShapeCircle

## Description

Overrides the current auto generated shape for use in collision detection, hit testing, and physics. A shape can be set without turning physics on, and by default all sprites are set to use the box shape, which is the fastest to setup. The circle is defined by specifying its center point relative to the sprite's current offset and a radius. For example, if the circle was to be centered on the sprite's offset point it would be specified at position 0,0. Any other value will offset the circle from the sprite. The radius is defined in x coordinates, due to world coordinates not necessarily representing the size of items on screen (e.g. 10 units in X may not be the same apparent size as 10 units in Y).
By default, setting a shape removes all other shapes assigned to the sprite and replaces it with this one. You can set shapes individually by specifying a shapeID greater than 0. Shape IDs start at 1 for the first shape, with 0 meaning delete all existing shapes before creating a new one at ID 1. This command only changes existing shapes, you can add additional shapes by using the AddSpriteShape commands.

## Definition

SetSpriteShapeCircle( iSpriteIndex, x, y, radius )

void agk::SetSpriteShapeCircle( UINT iSpriteIndex, float x, float y, float radius )

SetSpriteShapeCircle( iSpriteIndex, x, y, radius, shapeID )

void agk::SetSpriteShapeCircle( UINT iSpriteIndex, float x, float y, float radius, int shapeID )

## Parameters

- iSpriteIndex - The ID of the sprite to modify.
- x - The X coordinate of the center of the circle in sprite space.
- y - The Y coordinate of the center of the circle in sprite space.
- radius - The radius of the circle.
- shapeID - The ID of the shape to change, first shape is ID 1, 0=delete existing shapes and replace them with this new one