I'm currently trying to apply a fillGradient to a graphic, and then modify the graphic's gradient later using a variety of sliders. So far I've used the fillGradient["repeat"] and fillGradient["ramp"] properties successfully, but now I'd like to be able to change the angle of the gradient.
I assume that I would be able to do some math using the "from" and "to" properties, the loc of the graphic, and the radius (it's a circle) to effect a new gradient orientation, but I'm wondering if there is an easier way. I've tried setting the angle of the graphic, which didn't work, and I've looked all through the fillGradient documentation without seeing any applicable properties.
Any suggestions would be most helpful.
Setting the angle of a fillGradient?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 4003
- Joined: Sun Jan 07, 2007 9:12 pm
- Location: Bochum, Germany
Re: Setting the angle of a fillGradient?
Hi hwbehrens,
welcome to the forum.
I wish there were an angle property for the gradients, it would make for smother animations. As it is if you use the from/to/via you are bound to x,y coordinates which dont always make a smooth animation.
Maybe you find this helpful. In examining the fillgradient, which is an array, I use something like this:It takes the array and converts it to a return tab format suitable for displaying in a field of in this case in the message box.
I use this to manually change aspects of the fillgradient and use this later for the scripted change of the gradients.
If you like gradients (I do) look at RevOnline and search either for bernd or gradients and have a look at some of the stuff I did with gradients.
regards
Bernd
welcome to the forum.
look at from, to, via properties to change the angle. You do have to do the math yourself.hwbehrens wrote:I assume that I would be able to do some math using the "from" and "to" properties, the loc of the graphic, and the radius (it's a circle) to effect a new gradient orientation
I wish there were an angle property for the gradients, it would make for smother animations. As it is if you use the from/to/via you are bound to x,y coordinates which dont always make a smooth animation.
Maybe you find this helpful. In examining the fillgradient, which is an array, I use something like this:
Code: Select all
on mouseUp
put the fillGradient of grc 1 into tFillArray
combine tFillArray by return and tab
put tFillArray
end mouseUp
I use this to manually change aspects of the fillgradient and use this later for the scripted change of the gradients.
If you like gradients (I do) look at RevOnline and search either for bernd or gradients and have a look at some of the stuff I did with gradients.
regards
Bernd
Re: Setting the angle of a fillGradient?
Bernd,
Thanks for the suggestions. I took a look at your examples, and your beachball example was pretty much exactly what I am trying to do, specifically the gradients that orient to follow the mouse on drag. I had been using 'on mouseStillDown', but I think your variable flag method will provide much smoother animations.
Thanks again for the help!
- Hans
Thanks for the suggestions. I took a look at your examples, and your beachball example was pretty much exactly what I am trying to do, specifically the gradients that orient to follow the mouse on drag. I had been using 'on mouseStillDown', but I think your variable flag method will provide much smoother animations.
Thanks again for the help!
- Hans
-
- VIP Livecode Opensource Backer
- Posts: 4003
- Joined: Sun Jan 07, 2007 9:12 pm
- Location: Bochum, Germany
Re: Setting the angle of a fillGradient?
Hans,
I forgot to mention the gradient_explorer done by Scott Rossi of tactile media
http://www.tactilemedia.com/site_files/ ... er.rev.zip
Scott does amazing visual effects with Rev
http://www.tactilemedia.com/
at the top left go to software and then go for see all tutorials.
regards
Bernd
I forgot to mention the gradient_explorer done by Scott Rossi of tactile media
http://www.tactilemedia.com/site_files/ ... er.rev.zip
Scott does amazing visual effects with Rev
http://www.tactilemedia.com/
at the top left go to software and then go for see all tutorials.
regards
Bernd