Article View: rec.games.programmer
Article #1513Re: Mouse hits on a hex grid? Here's how:
From: Chris Phillips
Date: Sun, 13 Dec 1992 12:22
Date: Sun, 13 Dec 1992 12:22
9 lines
844 bytes
844 bytes
Here's a simple method if you have a little extra memory. Use a background buffer to draw a mirror image of the displayed hex grid only use one color per hex. Then when the mouse is clicked pick up the color on the background buffer thats at the same x,y as your mouse and thats your hex location. You could also use variations on this to just fine tune aproximations. eg narrow it down to 5 hexes and then use the back buffer to get the exact hex..
Technical Details
Message-ID:
<Bz76DE.8p@wimsey.bc.ca>Path:
arc1-ca.pugleaf.net!sparky!uunet!van-bc!chrispReferences:
<1992Dec10.230532.8752@leland.Stanford.EDU>Show Full Headers
Complete Article Headers
Newsgroups: rec.games.programmer Path: arc1-ca.pugleaf.net!sparky!uunet!van-bc!chrisp From: chrisp@wimsey.bc.ca (Chris Phillips) Subject: Re: Mouse hits on a hex grid? Here's how: Organization: Wimsey Information Services Date: Sun, 13 Dec 1992 12:22:25 GMT Message-ID: <Bz76DE.8p@wimsey.bc.ca> X-Newsreader: Tin 1.1 PL5 References: <1992Dec10.230532.8752@leland.Stanford.EDU> Lines: 9