Connecting Tech Pros Worldwide Help | Site Map

Mouse over of arbitrary shapes

 
LinkBack Thread Tools Search this Thread
  #1  
Old March 12th, 2008, 11:45 AM
amaccormack@gmail.com
Guest
 
Posts: n/a
Default Mouse over of arbitrary shapes

I can think of a number of ways do detect if the mouse if over (or
clicking on, etc) a arbitrary shaped bitmapped image (say, some sprite
where we want pixel-perfect click detection, not an enclosing
rectangle) , such as some kind of array with a mask in it, individual
lines of the sprite split into tiny rectangles, doing it all on the
server side via an XML request, but I wondered if anyone could offer
their experience or thoughts on the "best" way to do this that doesn't
eat too much client or server resources.

  #2  
Old March 12th, 2008, 02:05 PM
Erwin Moller
Guest
 
Posts: n/a
Default Re: Mouse over of arbitrary shapes

amaccormack@gmail.com wrote:
Quote:
I can think of a number of ways do detect if the mouse if over (or
clicking on, etc) a arbitrary shaped bitmapped image (say, some sprite
where we want pixel-perfect click detection, not an enclosing
rectangle) , such as some kind of array with a mask in it, individual
lines of the sprite split into tiny rectangles, doing it all on the
server side via an XML request, but I wondered if anyone could offer
their experience or thoughts on the "best" way to do this that doesn't
eat too much client or server resources.
Hi,

What about the good old imagemap?
Google 'imagemap', and you'll find a lot of resources.

You can make arbitrary shapes in it, and define also your JavaScript
handlers.

Here is a quick starters guide:
http://www.w3schools.com/tags/tag_map.asp

Of course you can also homecook your own routine, based on the x and y
position of the mouse over the image, but why reinvent the wheel?

Regards,
Erwin Moller
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.