Page 1 of 1

Gradient animation

PostPosted: Wed Feb 15, 2012 11:48 am
by 0plus1
What would be the best practice to make a background (tiled) that changes color in time with a nice transition?

I thought about a sine behaviour couple with a big gradient background, but it looks "expensive" memory wise, are there better options?

Thank you very much

Re: Gradient animation

PostPosted: Wed Feb 15, 2012 12:16 pm
by gaboduarte
Interesting question.

I'd create a 64px sprite with the gradient and scale it to the canvas size, then animate opacity and/or y position so it would appear slowly and seamlessly. The 64px sprite can keep things light, but you can use 128px if the results aren't pretty.

Re: Gradient animation

PostPosted: Wed Feb 15, 2012 12:41 pm
by Yann

Re: Gradient animation

PostPosted: Wed Feb 15, 2012 12:57 pm
by 0plus1
Thanks to both @Yann your project requires the canvas plugin, which is what?

Re: Gradient animation

PostPosted: Wed Feb 15, 2012 1:01 pm
by 0plus1
Nevermind I found it, wonderful plugin!