[plt-scheme] Writing a game and have questions

From: deepankar (deepankar.sharma at gmail.com)
Date: Sat Sep 20 11:23:32 EDT 2008

I am writing a game using DrScheme (actually am implementing this existing game http://www.bubblebox.com/play/puzzle/539.htm) and have some questions that I ran into along the way. 

I draw a tiled array of hexagons on a canvas using paths. Now I would like to detect which hexagon is beeing clicked on. One way of implementing this would be to render the hexagons to an offscreen buffer on startup - where each hexagon is drawn using a unique color. When the user clicks on screen, i fetch the color from the offscreen buffer and figure out the hexagon being clicked on. For this I have two questions 

1) Is it possible to draw a canvas to an offscreen buffer ?
2) Is it possible to fetch pixel values from a canvas. 

Feel free to suggest any alternative approaches to solving the same problem. 

Thanks,
Deepankar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20080920/644059b9/attachment.html>

Posted on the users mailing list.