Turning graphic effects off and on

Devin Asay devin_asay at byu.edu
Mon Dec 9 16:17:45 EST 2013


On Dec 9, 2013, at 1:58 PM, Scott Rossi wrote:

> 
> On 12/9/13 12:22 PM, "Devin Asay" <devin_asay at byu.edu> wrote:
> 
>> 
>>> Not sure where the IDE is saving graphic effects settings, but basically
>>> using the checkbox removes the graphic effect.
>>> set the colorOverlay of the btn "foo" to empty
>>> 
>>> If you don't need to rely on the IDE, you can store the graphic effect
>>> settings in a custom property or variable (it's an array).
>>> 
>>> You can test whether a graphic effect has been applied to an object by
>>> checking the array.
>>> if the dropshadow of btn "foo" is an array thenS
>> 
>> Right, I know about setting the effect to empty, but it's the saving of
>> the graphic effect settings that's tripping me up. Shouldn't something
>> like this work:
>> 
>> set the colorOverlay_save of btn "foo" to the colorOverlay of btn "foo"
>> --> I thought this would save the array to a new customProp, but it
>> just creates an empty custom prop
>> set the colorOverlay of btn "foo" to the colorOverlay_save of btn "foo"
> 
> The custom prop is not empty -- it's an array, so it doesn't show up in
> the inspector (if the save worked correctly, you'll see a notice in the
> inspector explaining this when you inspect the custom property).
> 
> You can also verify that a graphic effect can be transferred to another
> object like this:
> 
> set the colorOverlay of grc 1 to the colorOverlay of btn "foo"

Yeah, that works, so I could just create a hidden object that has the desired graphic effect settings and use this method.
> 
> What you describe above works as expected here (LC 6.1.3).  Are you sure
> about your property names and object references?

Strange, I was pretty careful to get the right object references. I am working in 6.5 at the moment so it's possible that something is broken there. 

Thanks for the ideas.

Devin Asay
Learn to code with LiveCode University
http://university.livecode.com





More information about the Use-livecode mailing list