How do I change color of sprite with lerp

Get help using Construct 2

Post » Tue Feb 16, 2016 4:09 am

In unity very easy.
Color.Lerp(Color.white, Color.black, Time.time);

How do I change color with built in replace color shader of construct2 with lerp?
I want a smoothed color changer function. I want use lerp with colors, it is possible?
B
14
S
2
Posts: 66
Reputation: 776

Post » Tue Feb 16, 2016 4:12 am

Mistakes were made.
B
47
S
23
G
100
Posts: 1,516
Reputation: 56,523

Post » Tue Feb 16, 2016 4:54 pm

When an object has an effect you can change the parameters with events. You should be able to find the action that does that under that object. You change each color component separately. So for example if you want the color to change as soon as the game starts, and take 4 seconds, do this:

every tick
--- set red to lerp(255, 0, min(1, time/4))
--- set green to lerp(255, 0, min(1, time/4))
--- set blue to lerp(255, 0, min(1, time/4))
B
85
S
27
G
85
Posts: 5,067
Reputation: 57,868


Return to How do I....?

Who is online

Users browsing this forum: Alex Bryant, Exabot [Bot], kiko2015, Momio, waguilar and 11 guests