GetSpriteHitGroup

Description

Returns the ID of the first sprite found under the point x,y in world coordinates, 0 if none. Sprites are ordered by depth so a sprite appearing above another in the draw order will be returned instead of the sprite behind it.

Filters results to only those sprites in the specified group. By default sprites are created in group 0, you can change this with SetSpriteGroup.

Takes into account the rotation and scale values of the sprite. It does not take into account the transparency of the sprite, only its collision shape. Uses the shape assigned to it from SetSpriteShape, if no shape is set it uses the sprite width and height as a box shape. If you are testing a mouse or touch coordinate, remember to convert it to world coordinates using ScreenToWorldX and ScreenToWorldY.

Definition

integer GetSpriteHitGroup( group, x, y )

Parameters