Color Replacer

New releases and general discussions.

Post » Sat Apr 04, 2009 11:02 pm

Seriously, Is there a way to have some type of color replacer? It would be just for Megaman. It could be useful for anyone who needs multiple colors for 1 sprites. Like a fighthing game. You could do it how MMF2 did it, but better.
"RGBAt( "SpritePalette", >Enter X coordinate<, >Enter Y coordinate<)"

This would grab the color on sprites X and Y values. Then it would replace all color that has the same color value as the one located on the X and Y

So first you'd select the color. A color dialog box would come up.
Or use the expression editor.

Replace Color
"RGBAt( "SpritePaletteTarget", 1, 3)"

Replace With
"RGBAt( "SpritePaletteData", 1, 3)"
B
11
S
3
G
8
Posts: 473
Reputation: 4,569

Post » Sat Apr 04, 2009 11:21 pm

I actually support this. You'll be surprised how much games uses this to recycle the same sprites but just with different colors..
B
16
S
10
G
5
Posts: 255
Reputation: 3,934

Post » Sat Apr 04, 2009 11:33 pm

A color replacer is easy to write in a pixel shader, but we don't have a colour parameter for shaders yet.

An expression to get the colour of a pixel on a sprite's texture would probably not be a good idea. That information is stored on the GPU, and events run on the CPU. It would be extremely slow if you requested that information.
Scirra Founder
B
359
S
214
G
72
Posts: 22,951
Reputation: 178,578

Post » Sun Apr 05, 2009 2:32 am

When you are able to, you can make it a pixel shader?
B
11
S
3
G
8
Posts: 473
Reputation: 4,569


Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 1 guest