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
15
S
2
Posts: 74
Reputation: 817

Post » Tue Feb 16, 2016 4:12 am

Mistakes were made.
B
58
S
29
G
115
Posts: 1,717
Reputation: 65,307

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
95
S
34
G
128
Posts: 5,497
Reputation: 81,682


Return to How do I....?

Who is online

Users browsing this forum: Kyledfrank and 52 guests