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

Returns True if the sprite's collision shape is touching the given box in world coordinates, False if not.

Syntax
Pascal
function InBox(const P1: TAgkPoint; const P2: TAgkPoint): Boolean; overload;
Parameters 
Description 
const P1: TAgkPoint 
The top left corner of the box in world coordinates. 
const P2: TAgkPoint 
The bottom right corner of the box in world coordinates. 

Whether the sprite is touching the box.

If the sprite does not have a shape it is assigned a box shape of its own which will remain after this command. This method takes into account the rotation and scale of the sprite when checking interesection.

Copyright (c) 2012. All rights reserved.