Article View: comp.sys.amiga.tech
Article #122Clicking on Irregular Shapes
From: schwager
Date: Tue, 20 Jun 1989 23:16
Date: Tue, 20 Jun 1989 23:16
29 lines
1927 bytes
1927 bytes
Hope someone can help with this C question:
Given an irregularly shaped object on a Screen, how can one tell if
the mouse button has been pressed inside of it? I don't want a box all
around or inside it; I want the object and exactly the object. Here's
why I ask: I'm going to be drawing a map on the screen (into a Backdrop
window of a workbenchscreen) and I want to be able to select individual
countries. Take something like Italy- if the user selects the toe of
the boot or the top, it should acknowledge either. But I don't want them
to be able to select Italy while they're just a tad into Switzerland. Nor
do I want them to be able to click in a corner of Italy and have them
wondering why the Amiga didn't grab their click.
I was looking at info about gadgets, but I didn't find them handy cuz
the active part is a box. I don't like the way collision detection is
handled with Bobs, either (I was thinking of checking the collision of
the mouse pointer with Bobs- but the way it's done, the collision
borders for the Bob become a square, also).
Also- the countries will be bordered, if that helps. Maybe I need to
define my countries by a series of borders, and see if the mouse click
falls inside a border.
So, wizened ones, can anyone help or point me in the direction of some
sample code? Thanks.
-Mike Schwager schwager@a.cs.uiuc.edu
-- {uunet,convex,pur-ee}!uiucdcs!schwager schwager%uiuc@csnet-relay.arpa
University of Illinois, Dept. of Computer Science
Technical Details
Message-ID:
<42700015@m.cs.uiuc.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!deimos.cis.ksu.edu!uxc.cso.uiuc.edu!uxc.cso.uiuc.edu!m.cs.uiuc.edu!schwagerShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!deimos.cis.ksu.edu!uxc.cso.uiuc.edu!uxc.cso.uiuc.edu!m.cs.uiuc.edu!schwager From: schwager@m.cs.uiuc.edu Newsgroups: comp.sys.amiga.tech Subject: Clicking on Irregular Shapes Message-ID: <42700015@m.cs.uiuc.edu> Date: 20 Jun 89 23:16:02 GMT Lines: 29 Nf-ID: #N:m.cs.uiuc.edu:42700015:000:1488 Nf-From: m.cs.uiuc.edu!schwager Jun 19 17:35:00 1989