AGK for Pascal
ContentsIndexHome
PreviousUpNext
TAgkText.HitText Method (Single, Single)

Returns True if the given point in world coordinates is inside the bounding box of the text.

Syntax
Pascal
function HitText(const X: Single; const Y: Single): Boolean; overload;
Parameters 
Description 
const X: Single 
X position in world coordinates to check. 
const Y: Single 
Y position in world coordinates to check. 

If you are testing a mouse or touch coordinate, remember to convert it to world coordinates using TAgkScene.ScreenToWorld

This does not take into account individual character positions. For example if you have positioned a character using SetCharPos or similar. Only the bounding box created by drawing the characters in their default positions is checked.

Copyright (c) 2012. All rights reserved.