mouse messages to invisible controls

Ken Norris (dialup) pixelbird at interisland.net
Mon Mar 11 14:32:00 EST 2002


on 3/11/02 9:06 AM, Dar Scott at dsc at swcp.com wrote:

> My young son is programming with Revolution.  He has card size
> images.  He wants to click on/over these and get different behavior
> depending on the zone.  He has tried invisible buttons and graphics
> but these don't seem to get mouseUp messages.
> 
> I haven't touched Hypercard for maybe a decade, it seems.  But, I
> thought there was a way to do this.
----------
This is wonderful news! Good for him!

There are several approaches:

1) Make your objects (controls) and their 'parts' transparent. They're still
there and can interact with the mouse, but you see right through them, like
pieces of cellophane. I use transparent buttons and fields quite often.
Sometimes I make them so I can see them for positioning and alignment, then
set their opaque properties to false.

2) Set zone boundaries in script variables and use mouseMove to tell if
you're within a certain zone. This is more difficult and you can't do much
with the mouse except in the card or image domain. You can constrain mouse
activity (but not the cursor itself).

3) Build your full screen image out of borderless smaller images, like
puzzle pieces. This will take some time, but it's a wonderful way to do it
because of the scripting manipulation possibilities. Something to think
about.

Best regards,
Ken N.




More information about the use-livecode mailing list