Irregularly shaped hotspots on image

Scott Rossi scott at tactilemedia.com
Sun Apr 22 12:54:36 EDT 2007


Recently, Viktoras Didziulis wrote:

> Is there a "standard" method of setting irregularly shaped invisible
> hotspots on images displayed on a stack ?
>  
> I have a few images with lots of fish on them. Need to highlight each fish
> and display its name on mouseEnter. Now I am drawing a polygon around each
> fish, setting its tool tip to fish name and putting a script that passes the
> long id of the polygon to a handler to change polygon's ink from noop to
> blend. And vice versa on mouseLeave. Additionally it displays contents of
> polygon's tooltip in a separate field (in case the tooltip does not appear
> immediately on mousenter).
>  
> The drawback of this approach is that while highlights are irregular,
> hotspots are still rectangular and sometimes hotspot of a large fish blocks
> all the small fishes around. So I have to adjust ordering of polygons
> sending larger to back and bringing the smallest to front to avoid blocking.
>  Are there other alternative techniques ?

What version of Rev are you using?  If I understand what you're doing, the
technique you describe *should* work in Rev 2.7 and later because mouse
detection in graphic objects was changed to use the real pixels occupied by
the graphics, as opposed to their rects.

If you're using Rev 2.6, you'll need to use images that contain transparency
to define your hotspots (PNG or GIF) as the mouse will be detected on the
non-transparent pixels.

Regards,

Scott Rossi
Creative Director
Tactile Media, Multimedia & Design





More information about the use-livecode mailing list