# SetSpriteShapePolygon

## 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 polygon is defined by a set of points (between 2 and 12) relative to the current sprite's offset. For example, a point of 0,0 would be centered on the sprite's offset point, any other value will be offset from this point.
Setting a shape removes all other shapes assigned to the sprite and replaces it with this one.

## Definition

SetSpriteShapePolygon( iSpriteIndex, numPoints, index, x, y )

void agk::SetSpriteShapePolygon( UINT iSpriteIndex, UINT numPoints, UINT index, float x, float y )

## Parameters

- iSpriteIndex - The ID of the sprite to modify.
- numPoints - The number of points to use in the polygon, min 2, max 12.
- index - set the index of the polygon
- x - X coordinate of the polygon to be added
- y - Y coordinate of the polygon to be added