What I'd do is write the group2d on another picture with the same height and width, and draw the group2d on it in pink. Now check pixel X,Y of that picture, and if it's pink, you clicked something. If you write all objects in different colors, you can determine wich object was clicked. No need to loop anything this way.
Maarten On 19/06/06, CV <[EMAIL PROTECTED]> wrote:
On Jun 19, 2006, at 11:23 AM, Alexander Bauza wrote: > List... > > Is there an easy way to know what object (Object2D) did I 'click' > in a Group2D??? The RectShape has a Contains(X,Y) which returns true if X,Y is within the bounds of the RectShape. So in the Canvas mousedown event, for example, you can loop through each item in your Group2D using IsA to identify a RectShape and when identified check its Contains property for true. However, other types of 2DObjects don't have a Contains property, so this technique may be easy or difficult to implement depending on your specific Group2D. It's quite likely that you may need to add an appropriate RectShape into your Group2D which can serve as a bounding rectangle for mouse clicks. Best regards, Jack _______________________________________________ Unsubscribe or switch delivery mode: <http://www.realsoftware.com/support/listmanager/> Search the archives of this list here: <http://support.realsoftware.com/listarchives/lists.html>
_______________________________________________ Unsubscribe or switch delivery mode: <http://www.realsoftware.com/support/listmanager/> Search the archives of this list here: <http://support.realsoftware.com/listarchives/lists.html>
