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
53
S
27
G
114
Posts: 1,699
Reputation: 64,446

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
94
S
33
G
114
Posts: 5,359
Reputation: 73,779


Return to How do I....?

Who is online

Users browsing this forum: Google [Bot], Yahoo [Bot] and 28 guests