Change colour of a sprite

Get help using Construct 2

Post » Tue May 29, 2012 8:39 pm

I have a white sprite, called MySprite.

I want to change it's colour to RED.

Searching around I found out that I need to do MySprite.RGB(255,0,0) however being a total newbie I cannot find my way where I need to input this in the Events.

any links or faqs where I might find some more help?

thanks a lot.
B
41
S
11
G
4
Posts: 428
Reputation: 7,356

Post » Tue May 29, 2012 9:14 pm

I didn't know you could change a sprite's color that way. I've done it with the text object, changing the font color, but not with sprites. My approach would be to create white and red versions of the sprite,load them as different frames of animation for the sprite, set animation speed to zero, and then pick the animation frames as desired.jimand2012-05-29 21:15:51
B
16
S
4
G
1
Posts: 40
Reputation: 2,705

Post » Tue May 29, 2012 9:21 pm

it will be impossible to load multiple coloured versions because i will have 30 sprites and each sprite can have 20 different colour combinations.

there must be some simple way to set the RGB values and colorize a sprite.
B
41
S
11
G
4
Posts: 428
Reputation: 7,356

Post » Tue May 29, 2012 10:25 pm

You can't directly apply a color filter on a sprite. There is a plugin that applies a color filter to a sprite's image.

You can mix two sprites with the "source atop" effect:
http://dl.dropbox.com/u/5426011/examples11/colorize.capx

Another method would be to just have a silhouette sprite of a solid color always on top of the sprite you want to color.
B
79
S
24
G
54
Posts: 4,743
Reputation: 40,749

Post » Tue May 29, 2012 10:27 pm

@R0J0hound, I never knew that! Clever.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Wed May 30, 2012 7:50 am

@R0J0hound this is pretty smart... i shall steal it :D
B
33
S
6
G
7
Posts: 338
Reputation: 7,424

Post » Wed May 30, 2012 8:03 am

What is the name of the plugin that applies a color filter to a sprite's image?

Thanks.
B
41
S
11
G
4
Posts: 428
Reputation: 7,356

Post » Sat Nov 16, 2013 7:11 pm

Hi, does anyone have an example of changing a sprite colour when clicking on a button?

I've searched the forums and this post is the closest I found

cheers
Dave
B
5
Posts: 15
Reputation: 328


Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 25 guests