# GetSpriteXFromPixel

## Description

Converts a pixel point on the sprite's image to the point on the sprite's surface that represents where that pixel is. For example if a 200x100 pixel image was assigned to a sprite of size 10x10, then calling this command with a pixel value of 100 (center of the image) would return 5 (center of the sprite). The sprite must have an image assigned for this to work or it will always return 0. The command is not limited by the size of the image or sprite, so in the above example a pixel value of 300 or -10 would both be valid.

## Definition

float GetSpriteXFromPixel( iSpriteIndex, x )

float agk::GetSpriteXFromPixel( UINT iSpriteIndex, int x )

## Parameters

- iSpriteIndex - The ID of the sprite to check.
- x - The x coordinate of the pixel to check.