[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: New Idea, Re: Code review



Philipp Gühring <p.guehring@enemy.org> writes:

> In the game code, you have to load the picture, and when a
> pointer-button is clicked, you just have to lookup the
> pointer-coordinates in the picture, and the color there tells you,
> which button was clicked. Very speedy!

I ones used a similar technic for selecting polygons in a simple
vector editor. I simply drawed the image again into memory (when
needed) and used the color index to get the object id.
I wouldn't use it for rectangle buttons, but as you allready said it
can be quite handy if you have to select non rectangle static
objects. 

-- 
                                                 http://pingus.seul.org | 
Ingo Ruhnke <grumbel@gmx.de>             http://home.pages.de/~grumbel/ |
------------------------------------------------------------------------+