# AddSpriteShapePolygon

## Description

Adds a new shape to the sprite, in addition to any it already has. These additional shapes only apply to physics sprites and must be added after a sprite has been set to use physics.
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. Points are defined one at a time by calling this command multiple times, with index starting at 0. Once the index equals numPoints-1 then the shape will be created using the previously defined points. Once you start defining points you must complete the process by reaching index=numPoints-1 before defining points for any other shape.
This will recalculate the sprite's mass and center of mass values.

## Definition

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

void agk::AddSpriteShapePolygon( 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 - Index for points, so you can specify index 0, 1, 2 etc.
- x - X position for the specified point.
- y - Y position for the specified point.