Putting the mouseDown handler in the image should fix that. If there are several images add a behavior that catches the mouseDown message.
"opaque pixels"
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- VIP Livecode Opensource Backer
- Posts: 7230
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: "opaque pixels"
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- Livecode Opensource Backer
- Posts: 9375
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: "opaque pixels"
If folk had downloaded my stack with the octopus the rest of this discussion would not have taken place.
Re: "opaque pixels"
Come on, guys, Samuele wants to fire a "mousedown" when he clicks the transparent pixels of an image!
That is hard to misunderstand, and my stack shows the workaround, since this is not possible with a "mousedown"
handler in the image.
That is hard to misunderstand, and my stack shows the workaround, since this is not possible with a "mousedown"
handler in the image.
-
- Livecode Opensource Backer
- Posts: 9375
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: "opaque pixels"
No, he doesn't, I am afraid you have things the
wrong way round.
wrong way round.
Re: "opaque pixels"
Well, that is how I understood his question.
Seems unambiguous to me.is there a way to activate "mouseDown" only if the user clicks on the "opaque pixels" of the object?
-
- VIP Livecode Opensource Backer
- Posts: 7230
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: "opaque pixels"
Opaque in this case means visible. He wants a mousedown to fire only if the pixels are visible.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: "opaque pixels"
Aaaaaaaahhhhhhh, "opaque", yes, how embarrassing, sorry for the fuzz.
Re: "opaque pixels"
Thanks guys that was a funny read
@samuele -- yes long and short of it is that PNG images will allow you to do this.
There is a lengthy discussion of this here: viewtopic.php?f=7&t=35388&hilit=bullseye, i had jumped in halfway down the thread with a similar issue and came eventually to the conclusion that PNG is the only way to go, as Richmond advised then and now...
Stam
@samuele -- yes long and short of it is that PNG images will allow you to do this.
There is a lengthy discussion of this here: viewtopic.php?f=7&t=35388&hilit=bullseye, i had jumped in halfway down the thread with a similar issue and came eventually to the conclusion that PNG is the only way to go, as Richmond advised then and now...
Stam
-
- VIP Livecode Opensource Backer
- Posts: 7230
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: "opaque pixels"
Someone might think that English wasn't your first language. But we still think you're clever.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- Livecode Opensource Backer
- Posts: 9375
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: "opaque pixels"
Nobody should ever say that Klaus is anything but clever, but as we all get older he should
also be allowed the odd 'senior moment'.
It was Klaus, in 2001, who pointed out to me why one should generally use mouseUp instead of mouseDown,
and I will forgive him everything for that piece of invaluable advice.
And if he makes half the mistakes I do . . .
also be allowed the odd 'senior moment'.
It was Klaus, in 2001, who pointed out to me why one should generally use mouseUp instead of mouseDown,
and I will forgive him everything for that piece of invaluable advice.
And if he makes half the mistakes I do . . .
Re: "opaque pixels"
allright, thanks, but my probllem is actually this
Thanks!
Samuele.
sorry, my bad I didn't specify that I meant an id of an image in a button.Thanks!
Samuele.
Samuele.
Re: "opaque pixels"
You can't do this as an image in a button; if you click a button, you click a button regardless if the image is there or not.
Instead you need to import the PNG image as control (FILE menu -> import as control -> image)
Then add a mouseUp handler to the image's script.
download an example stack here: https://www.mediafire.com/file/nq7f5sdn ... e.zip/file
Instead you need to import the PNG image as control (FILE menu -> import as control -> image)
Then add a mouseUp handler to the image's script.
download an example stack here: https://www.mediafire.com/file/nq7f5sdn ... e.zip/file
Re: "opaque pixels"
yes, but that will increase the size of the stack a lot (and then the app, and my stack is already large uselessly), because the images i import i use them more then once, that's why i made buttons with icons.
or is there a way to reduce the stack size?
thanks.
or is there a way to reduce the stack size?
thanks.
Samuele.
Re: "opaque pixels"
No need to import all of your images!
This will also work with referenced images and will not add much to the filesize of the stack!
This will also work with referenced images and will not add much to the filesize of the stack!
-
- Livecode Opensource Backer
- Posts: 9375
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: "opaque pixels"
Here's a stack which has an image on the first card (it has 4 cards)
and a graphic object "rr" on cards 2, 3 & 4 with its backGroundPattern set
to the image on card 1.
- - -
graphic objects WILL behave like the images they have as backGroundPatterns insofar as whether
mouseDown/Up clicks get a reaction out of transparent areas.
and a graphic object "rr" on cards 2, 3 & 4 with its backGroundPattern set
to the image on card 1.
- - -
graphic objects WILL behave like the images they have as backGroundPatterns insofar as whether
mouseDown/Up clicks get a reaction out of transparent areas.
- Attachments
-
- Multiple usage.livecode.zip
- Here's the stack.
- (71.4 KiB) Downloaded 71 times