Scripting Gradient Property "via"
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Scripting Gradient Property "via"
Hello, everyone!
I am trying to script a gradient fill on a templateObject from top to bottom instead of side to side (default).
I understand that this is controlled using the "via" property based on the dictionary entry, but have no idea what " a coordinate specifying the intermediate point of the gradient..." refers to. What is the coordinate representing and how is written?
If someone could provide an example, I would really appreciate it.
Many thanks!
I am trying to script a gradient fill on a templateObject from top to bottom instead of side to side (default).
I understand that this is controlled using the "via" property based on the dictionary entry, but have no idea what " a coordinate specifying the intermediate point of the gradient..." refers to. What is the coordinate representing and how is written?
If someone could provide an example, I would really appreciate it.
Many thanks!
Re: Scripting Gradient Property "via"
Hi.
I don't use gradients at all, but a reading of the dictionary entry tells me that (maybe?) if you specify the "linear", "from" and "to" parameters of the properties array, you might be able to orient the gradient as you wish. This property looks like it needs practice and experimentation.
Craig Newman
I don't use gradients at all, but a reading of the dictionary entry tells me that (maybe?) if you specify the "linear", "from" and "to" parameters of the properties array, you might be able to orient the gradient as you wish. This property looks like it needs practice and experimentation.
Craig Newman
Re: Scripting Gradient Property "via"
Thanks, Craig, but just setting the "from" and "to" on a "linear" fills the object from side to side.
I have experimented with it, but am getting gradients filling every direction but what I want (top to bottom).
If anyone can help explain what the via coordinates represent and how they're written, I could reference them dynamically in my script based on other object properties (topLeft, bottomLeft...).
Help.
I have experimented with it, but am getting gradients filling every direction but what I want (top to bottom).
If anyone can help explain what the via coordinates represent and how they're written, I could reference them dynamically in my script based on other object properties (topLeft, bottomLeft...).
Help.

Re: Scripting Gradient Property "via"
Hi.
So if the two coordinates are at the top and bottom of the graphic, perhaps with the same "x" value, the gradient still fills from left to right?
Craig
So if the two coordinates are at the top and bottom of the graphic, perhaps with the same "x" value, the gradient still fills from left to right?
Craig
Re: Scripting Gradient Property "via"
There's a great thread here http://forums.livecode.com/viewtopic.ph ... 8&start=30 (read the whole thing) with an evolution of gradient tools which you can pick apart to find the details you need.
Re: Scripting Gradient Property "via"
Hi Todd,
nice to see you again...
have a look at this post where I reference a tool to explore gradients made by Scott Rossi: gradientexplorer.livecode
http://forums.livecode.com/phpBB2/viewt ... 669#p16669
I just tried and the link is still alive.
It makes it easy to understand what happens in gradients, also when setting the from, to and via.
Kind regards
Bernd
nice to see you again...

have a look at this post where I reference a tool to explore gradients made by Scott Rossi: gradientexplorer.livecode
http://forums.livecode.com/phpBB2/viewt ... 669#p16669
I just tried and the link is still alive.
It makes it easy to understand what happens in gradients, also when setting the from, to and via.
Kind regards
Bernd
Re: Scripting Gradient Property "via"
Hi Todd,
I reread your original posting today and realized that you asked for an example for the templateGraphic.
Here it is for a linear fillgradient running from top to bottom done in the templateGraphic.
See comments in the script and feel free to ask if unclear.
Kind regards
Bernd
I reread your original posting today and realized that you asked for an example for the templateGraphic.
Here it is for a linear fillgradient running from top to bottom done in the templateGraphic.
See comments in the script and feel free to ask if unclear.
Kind regards
Bernd
- Attachments
-
- fillgradientGraphic.livecode.zip
- (1.87 KiB) Downloaded 253 times
Re: Scripting Gradient Property "via"
Bernd,
Thank you so much for the solution to my problem!
I have been away from the forums for a while, but coding nonetheless.
Hope you've been doing well.
Thanks, again.
Todd
Thank you so much for the solution to my problem!
I have been away from the forums for a while, but coding nonetheless.
Hope you've been doing well.
Thanks, again.
Todd