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

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

Syntax
Pascal
function InBox(const X1: Single; const Y1: Single; const X2: Single; const Y2: Single): Boolean; overload;
Parameters 
Description 
const X1: Single 
The X coordinate of the top left corner of the box in world coordinates. 
const Y1: Single 
The Y coordinate of the top left corner of the box in world coordinates. 
const X2: Single 
The X coordinate of the bottom right corner of the box in world coordinates. 
const Y2: Single 
The Y coordinate of 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.