AGK for Pascal
ContentsIndexHome
PreviousUpNext
TAgkSprite.HitGroup Method (Integer, TAgkPoint)

Returns the first sprite found under the point X,Y in world coordinates and belonging to the given group. Nil if none.

Syntax
Pascal
class function HitGroup(const Group: Integer; const P: TAgkPoint): TAgkSprite; overload;
Parameters 
Description 
const Group: Integer 
The group ID to check. 
const P: TAgkPoint 
The position in world coordinates to check. 

The sprite at this position and in this group, or nil.

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 Group

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 Shape. 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 TAgkScene.ScreenToWorld.

Copyright (c) 2012. All rights reserved.