# SetSpritePositionByOffset

## Description

Immediately positions the specified sprite to the given X,Y world coordinates. The default world coordinate system has 0,0 as the top left corner, and 100,100 as the bottom right hand corner of the screen (this can be changed using SetVirtualResolution).
This function always positions the sprite using its current offset. For example if the current offset is the center of the sprite this command will place the center of the sprite at the given coordinates.

## Definition

SetSpritePositionByOffset( iSpriteIndex, fX, fY )

void agk::SetSpritePositionByOffset( UINT iSpriteIndex, float fX, float fY )

## Parameters

- iSpriteIndex - The ID of the sprite to position
- fX - The X coordinate to position the sprite, can use decimal values.
- fY - the Y coordinate to position the sprite, can use decimal values.