Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!rutgers!cbmvax!cbmehq!cbmger!peterk From: peterk@cbmger.UUCP (Peter Kittel GERMANY) Newsgroups: comp.sys.amiga.programmer Subject: Re: Clicking on irregular shapes? Message-ID: <1029@cbmger.UUCP> Date: 28 Mar 91 13:33:41 GMT References: <1991Mar27.212214.6204@orfeo.radig.de> Reply-To: peterk@cbmger.UUCP (Peter Kittel GERMANY) Organization: Commodore Bueromaschinen GmbH, West Germany Lines: 23 In article <1991Mar27.212214.6204@orfeo.radig.de> eric@orfeo.radig.de (Eric Tuerlings) writes: > >I can remember there was a discussion last year about: "Clicking on >irregualar shapes". Because I want to use irregular shapes to click on, >I am interested in a solution to this problem, since I found nothing else >than to click on rectangle shapes only. How about this brute force attempt: When the user clicks, you do a flood fill from that point with a certain color different from the previous one. Previously you have stored for every shape on your screen a (x,y) coordinate pair. Then you do a loop and look in every of these shapes at that very point, if it changed its color (the flood fill should have reached also this). Thus you get two effects: The user gets an immediate feedback where he clicked, and you can find which shape it was. (I imagine you want to do something like clicking on a world map and identifying the country.) Hello to Frankfurt! -- Best regards, Dr. Peter Kittel // E-Mail to \\ Only my personal opinions... Commodore Frankfurt, Germany \X/ {uunet|pyramid|rutgers}!cbmvax!cbmger!peterk