Re: "within graphic" question

2021-02-22 Thread Roger Guay via use-livecode
 I’ve had this problem before and solved it with a work-around/hack using the 
intersect of 2 graphics with small alpha values. 

Roger

> On Feb 22, 2021, at 2:02 PM, jbv via use-livecode 
>  wrote:
> 
> Le 2021-02-22 15:26, Tore Nilsen via use-livecode a écrit :
>> Since the properties of the arc is available even if it is invisible,
>> this will work though:
>> on mouseDown
>> put isWithin("myGraphic",the clickLoc)
>> end mouseDown
>> function isWithin pGraphic pClickLoc
>> if pClickLoc is within the rect of grc pGraphic then
>> return true
>> else
>> return false
>> end if
>> end isWithin
> 
> Thank you, but this won't work for I need to test the
> exact shape of the graphics, not its bounding box...
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: "within graphic" question

2021-02-22 Thread jbv via use-livecode

Le 2021-02-22 15:26, Tore Nilsen via use-livecode a écrit :


Since the properties of the arc is available even if it is invisible,
this will work though:

on mouseDown

put isWithin("myGraphic",the clickLoc)

end mouseDown


function isWithin pGraphic pClickLoc

if pClickLoc is within the rect of grc pGraphic then

return true

else

return false

end if

end isWithin


Thank you, but this won't work for I need to test the
exact shape of the graphics, not its bounding box...

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: "within graphic" question

2021-02-22 Thread Ken Ray via use-livecode
If you're willing to do something "hackish", you could do this:

on mouseDown
  lock screen
  show grc "mygraphic"
  put within(grc "mygraphic",the clickloc)
  hide grc "mygraphic"
  unlock screen
end mouseDown

:D

Ken


> On Feb 22, 2021, at 1:49 PM, jbv via use-livecode 
>  wrote:
> 
> Hi list,
> 
> I have a graphic made of a list of points. This graphic is opaque
> and invisible, its filled property is set to true (according to
> the doc).
> In my card script I have something like :
> on mousedown
>  put within(grc "mygraphic", the clickloc)
> end mousedown
> 
> but it always returns false, even when I click
> inside the clickable area of the graphic...
> What am I missing ?
> 
> Thanks in advance.
> jbv
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: "within graphic" question

2021-02-22 Thread Tore Nilsen via use-livecode



> 22. feb. 2021 kl. 21:26 skrev Tore Nilsen via use-livecode 
> :
> 
> 
> 
>> 22. feb. 2021 kl. 21:14 skrev Richard Gaskin via use-livecode 
>> :
>> 
>> jbv wrote:
>>> I have a graphic made of a list of points. This graphic is opaque
>>> and invisible, its filled property is set to true (according to
>>> the doc).
>>> In my card script I have something like :
>>> on mousedown
>>>  put within(grc "mygraphic", the clickloc)
>>> end mousedown
>>> but it always returns false, even when I click
>>> inside the clickable area of the graphic...
>>> What am I missing ?
>> 
>> IIRC invisible objects are removed from not only the rendering queue, but 
>> hit-testing as well.
>> 
> 
> Since the properties of the arc is available even if it is invisible, this 
> will work though:
> 
> on mouseDown
> 
> put isWithin("myGraphic",the clickLoc)
> 
> end mouseDown
> 
> 
> function isWithin pGraphic pClickLoc
> 
> if pClickLoc is within the rect of grc pGraphic then
> 
> return true
> 
> else
> 
> return false
> 
> end if
> 
> end isWithin
> 
> 
> Best regards
> TORE NILSEN

I missed the part where you described your graphic. My solution will only work 
on a graphic that is a rectangle.

Tore Nilsen

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: "within graphic" question

2021-02-22 Thread Tore Nilsen via use-livecode



> 22. feb. 2021 kl. 21:14 skrev Richard Gaskin via use-livecode 
> :
> 
> jbv wrote:
>> I have a graphic made of a list of points. This graphic is opaque
>> and invisible, its filled property is set to true (according to
>> the doc).
>> In my card script I have something like :
>> on mousedown
>>   put within(grc "mygraphic", the clickloc)
>> end mousedown
>> but it always returns false, even when I click
>> inside the clickable area of the graphic...
>> What am I missing ?
> 
> IIRC invisible objects are removed from not only the rendering queue, but 
> hit-testing as well.
> 

Since the properties of the arc is available even if it is invisible, this will 
work though:

on mouseDown

put isWithin("myGraphic",the clickLoc)

end mouseDown


function isWithin pGraphic pClickLoc

if pClickLoc is within the rect of grc pGraphic then

return true

else

return false

end if

end isWithin


Best regards
TORE NILSEN

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: "within graphic" question

2021-02-22 Thread Randy Hengst via use-livecode
Would it work in your case if you left the graphic visible and set the 
blendLevel to 99?

be well,
randy

> On Feb 22, 2021, at 2:14 PM, Richard Gaskin via use-livecode 
>  wrote:
> 
> jbv wrote:
>> I have a graphic made of a list of points. This graphic is opaque
>> and invisible, its filled property is set to true (according to
>> the doc).
>> In my card script I have something like :
>> on mousedown
>>   put within(grc "mygraphic", the clickloc)
>> end mousedown
>> but it always returns false, even when I click
>> inside the clickable area of the graphic...
>> What am I missing ?
> 
> IIRC invisible objects are removed from not only the rendering queue, but 
> hit-testing as well.
> 
> -- 
> Richard Gaskin
> Fourth World Systems
> Software Design and Development for the Desktop, Mobile, and the Web
> 
> ambassa...@fourthworld.comhttp://www.FourthWorld.com
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: "within graphic" question

2021-02-22 Thread Richard Gaskin via use-livecode

jbv wrote:

I have a graphic made of a list of points. This graphic is opaque
and invisible, its filled property is set to true (according to
the doc).
In my card script I have something like :
on mousedown
   put within(grc "mygraphic", the clickloc)
end mousedown

but it always returns false, even when I click
inside the clickable area of the graphic...
What am I missing ?


IIRC invisible objects are removed from not only the rendering queue, 
but hit-testing as well.


--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


"within graphic" question

2021-02-22 Thread jbv via use-livecode

Hi list,

I have a graphic made of a list of points. This graphic is opaque
and invisible, its filled property is set to true (according to
the doc).
In my card script I have something like :
on mousedown
  put within(grc "mygraphic", the clickloc)
end mousedown

but it always returns false, even when I click
inside the clickable area of the graphic...
What am I missing ?

Thanks in advance.
jbv

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode