Set the fillGradient ....
Richard Gaskin
ambassador at fourthworld.com
Thu Sep 1 12:00:45 EDT 2016
Roger Guay wrote:
>
>> On Sep 1, 2016, at 5:41 AM, Randy Hengst wrote:
>>
>> To make this work via script, I’ve done two things… the easiest is
>> to set the grc that I want to change to the size and position of
>> the a grc master with the fill gradient I want to match… in this
>> example, the script is in the grc to be changed:
>>
>> on mouseDown
>> local tStartLoc
>> put the loc of target into tStartLoc
>> set the loc of target to the loc of grc "Blue MasterChip"
>> set the fillGradient of target to the fillGradient of grc "Blue
MasterChip"
>> set the loc of target to tStartLoc
>> end mouseDown
>
> Wow, Randy, that works! Is this a workaround to a bug or what??
At the moment it's just how it works. Some of the elements for
gradients use positioning, which is currently most commonly handled
throughout LiveCode in coordinates local to the card.
This may be among the cases we come across now and then where it would
be helpful if we had coordinates local to the object.
I don't believe we have any functions or other language elements that
use object-local coordinates, but if we did what should those look like?
But as I think about that, even if we did have something like
localToObjectLocal that would take at least as many lines of code to
copy gradient data from one object to another as simply setting the loc
and having the coords update themselves.
Hmmm....
--
Richard Gaskin
Fourth World Systems
Software Design and Development for the Desktop, Mobile, and the Web
____________________________________________________________________
Ambassador at FourthWorld.com http://www.FourthWorld.com
More information about the use-livecode
mailing list