Passing mouse events

Ken Ray kray at sonsothunder.com
Thu Jan 23 21:19:01 EST 2003


Christian,

One approach is to not add an overlay on top of an image, but to swap images
in a single image object. This would give you the transparency, the single
object that would have a script, but be able to use different images. For
example, suppose you had three graphics: one "normal" (not glowing), one
"pushed in" (glowing), and one "popped out" (glowing). You could then do
something like this:

-- Script of the image with "normal" showing
-- local property "glowing" keeps track of state

on mouseDown
  put img "pushed in" into me
end mouseDown

on mouseUp
  if the glowing of me is true then
    put img "normal" into me
    set the glowing of me to false
  else
    put img "popped out" into me
    set the glowing of me to true
  end if
end mouseUp

Oh - one thing - it helps if the images are all the same size.

Hope this helps,

Ken Ray
Sons of Thunder Software
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/


----- Original Message -----
From: "xian" <xianman at mac.com>
To: <use-revolution at lists.runrev.com>
Sent: Thursday, January 23, 2003 6:25 PM
Subject: Passing mouse events


> Hi all, I am trying to create some cool custom button effects with Rev
> right now but I have a question. First, I'll explain how my buttons
> work...
>
> Their appearance are big aqua inspired shapes, meant for use in a
> touchscreen application. When the user touches a button I have semi
> transparent overlays that become visible that give the appearance that
> the button is not only "pushed in" but it also glows bright. When the
> user releases their finger from the screen, the button pops back out
> but remains lit up with another semi transparent overlay (dimmer than
> the glow effect overlay). Then if the user pushes the button again,
> same effects happen but the button goes back to it's non-lit state.
>
> So, my problem is that when the "lit up" overlay becomes visible, it
> blocks the mouse events to the button that is underneath it. Is it
> possible to pass all mouse events from one object to another? Or maybe
> make an object "invisible" to mouse events? Or is their perhaps a
> better way of doing what I'm trying to accomplish altogether?
>
> BTW, I can't use normal buttons with custom icon rollover effects
> because my buttons are mostly round and I only want them to be
> activated by their shape, not the square of a button. This is why I'm
> using transparent .png files.
>
> TIA!
> Christian
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
>




More information about the use-livecode mailing list