Gradual Color Filter Change

For questions about using Classic.

Post » Thu Sep 16, 2010 11:20 pm

Hey all

I was wondering if someone could show me how to change a color filter gradually.
Like in a space of time it gradually changes from one shade to another.
Its for a game im not going to release yet and it would be most appreciated
Thanks if you can help

Smartcartridge
B
3
S
1
G
2
Posts: 16
Reputation: 857

Post » Thu Sep 16, 2010 11:33 pm

This should work.

percentageFromColor1toColor2 should be a value from 0 to 1
the ValueOf numbers should be from 0 to 255

[code:4mc2vspg]rgb(lerp(redValueOfcolor1,redValueOfcolor2,percentageFromColor1toColor2),lerp(greenValueOfcolor1,greenValueOfcolor2,percentageFromColor1toColor2),lerp(blueValueOfcolor1,blueValueOfcolor2,percentageFromColor1toColor2))[/code:4mc2vspg]
B
48
S
10
G
9
Posts: 1,224
Reputation: 8,449

Post » Fri Sep 17, 2010 12:59 am

Davio was a bit faster...

Anyway, the same technique he described, but in a documented .cap


Download ChangeColor.cap
Image
B
24
S
8
G
10
Posts: 1,821
Reputation: 8,279

Post » Sat Sep 18, 2010 10:24 pm

Thanks Guys.

Exactly what i need
B
3
S
1
G
2
Posts: 16
Reputation: 857


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 10 guests