How do I change palette colors?

Get help using Construct 2

Post » Wed Mar 19, 2014 10:00 pm

I mean in the style of Megaman series, and I do not mean simply changing the hue.
B
11
S
3
G
8
Posts: 473
Reputation: 4,569

Post » Wed Mar 19, 2014 10:22 pm

I found it, but can't seem to change anything via the event editor.
B
11
S
3
G
8
Posts: 473
Reputation: 4,569

Post » Thu Mar 20, 2014 12:39 am

Using the Replace Color effect, right? This is how I did it:

Untitled-1.png


I have the 3 Replace Color effects on it, one for each color, and the R,G,B Source is already set to the default colors of the sprite.
I also have the palette values on a CSV table, that's the whole bold part of the event, getting the correct color from the CSV

And this is the result:

record10.gif
You do not have the required permissions to view the files attached to this post.
B
84
S
22
G
15
Posts: 1,039
Reputation: 15,249

Post » Fri Mar 21, 2014 10:39 am

Hmm, have no idea what you mean about a CVS table.
B
11
S
3
G
8
Posts: 473
Reputation: 4,569

Post » Fri Mar 21, 2014 7:32 pm

You don't NEED to do it, I just did it to keep my code clean, but you can add all colors by hand.

Code: Select all
On function "ColorChange"
    Parameter 0 = 0
        : Set effect "ReplaceColor1" parameter 4 to R1
        : Set effect "ReplaceColor1" parameter 5 to G1
        : Set effect "ReplaceColor1" parameter 6 to B1
    Parameter 0 = 1
        : Set effect "ReplaceColor1" parameter 4 to R2
        : Set effect "ReplaceColor1" parameter 5 to G2
        : Set effect "ReplaceColor1" parameter 6 to B2

Where parameter 0 is the "id" if the color, and R1B1G1 is the first color, R2B2G2 is the second color and so on
B
84
S
22
G
15
Posts: 1,039
Reputation: 15,249

Post » Sat Mar 22, 2014 9:35 am

Ah, okay, so is the parameter like a single digit integer?
B
11
S
3
G
8
Posts: 473
Reputation: 4,569

Post » Sat Mar 22, 2014 7:02 pm

Yeah. Parameter 1, 2 and 3 is the original color you want to change R, G and B. Param 4, 5 and 6 is the R, G and B of the color you want it to be
B
84
S
22
G
15
Posts: 1,039
Reputation: 15,249

Post » Tue Dec 23, 2014 7:46 am

@7Soul - I hate to bring back an old thread like this, but from what I understand, replace color has limited support in terms of browsers and mobile devices. Is that correct?
B
72
S
18
G
9
Posts: 376
Reputation: 9,106

Post » Fri Dec 26, 2014 3:33 am

@mudmask No problem. I guess it'll only work on a platform that supports webgl
B
84
S
22
G
15
Posts: 1,039
Reputation: 15,249

Post » Fri Dec 26, 2014 3:40 am

Isn't parameter 6 (7th parameter but 0-index based) the tolerance? I think 0,1,2 are source colors and 3,4,5 are new colors

I have a problem with the tolerance, what value should I use if I only want the exact color (source) to be replaced and nothing else?

I tried 1 or 0 or 30 or 50 or 100, seems there are some pixels (of source color) still not being recolored
B
16
S
7
Posts: 301
Reputation: 2,726

Next

Return to How do I....?

Who is online

Users browsing this forum: lukewasthefish and 13 guests