Hi All,
I'm coming back with this problem
I search a way to know if the click is within the colored part of the blue oval.
The "by color" way work well but an "by angle" way should be better.
I write a script to do that but it doesn't work yet as you can see in the attached stack
Thank again for help
Kind regards
Jean-marc
isClicWithinOvalColoredPart
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
isClicWithinOvalColoredPart
- Attachments
-
- isClicWithinOvalColoredPart.livecode.zip
- (1.73 KiB) Downloaded 140 times
https://alternatic.ch
Re: isClicWithinOvalColoredPart
Jean-Marc.
The "color" check portion of your handler needs to be in the card script, because if you click outside the object area, it will not work. You have to watch the reference to the target in line 34 if you do, though.
It seems like you can find the equations of the two lines that define your arc section, since you know the slopes of the two radii and also the center of the graphic. With that you can take the clickLoc and determine whether that loc is greater or lesser than the substitution of that point into the two equations. If it is greater than both, then the point lies outside the area subtended by the arc section. At least for a positive-going pair of lines in quadrant 1. The determination may have to be a mixture of < and > in the other three quadrants. I have not played with those yet.
Hey HH, or whatever your name is. A little help here?
Craig
The "color" check portion of your handler needs to be in the card script, because if you click outside the object area, it will not work. You have to watch the reference to the target in line 34 if you do, though.
It seems like you can find the equations of the two lines that define your arc section, since you know the slopes of the two radii and also the center of the graphic. With that you can take the clickLoc and determine whether that loc is greater or lesser than the substitution of that point into the two equations. If it is greater than both, then the point lies outside the area subtended by the arc section. At least for a positive-going pair of lines in quadrant 1. The determination may have to be a mixture of < and > in the other three quadrants. I have not played with those yet.
Hey HH, or whatever your name is. A little help here?
Craig
Re: isClicWithinOvalColoredPart
Salut Jean-Marc,
ravi de te revoir.
Here is a little different formula to get the angle of the mouse and for me it works
Kind regards
Bernd
ravi de te revoir.
Here is a little different formula to get the angle of the mouse and for me it works
Kind regards
Bernd
- Attachments
-
- Jean-Marc InsideAngle.livecode.zip
- (1.67 KiB) Downloaded 149 times
Re: isClicWithinOvalColoredPart
Salut Bernd,
Thanks a lot
Amazing man.
I tested your script and it works for me
The "angle way" is better than the "color way" if we have ovals with the same backgroundcolor
Kind regards
Jean-Marc
Thanks a lot
Me too. I'm happy to know you can see me through the web without camera.ravi de te revoir.
Amazing man.
I tested your script and it works for me
The "angle way" is better than the "color way" if we have ovals with the same backgroundcolor
Kind regards
Jean-Marc
https://alternatic.ch
Re: isClicWithinOvalColoredPart
Hi Craig,
Sorry
Bernd made me so happy with his script. I have forgotten to you thank for explanations.
This team is definitively the best I never meet.
Thank again
Jean-Marc
Sorry
Bernd made me so happy with his script. I have forgotten to you thank for explanations.

This team is definitively the best I never meet.

Thank again
Jean-Marc
https://alternatic.ch