Simple but useful functions - Recolor

Talk about making games.

Simple but useful functions - Recolor

Postby Hblade » Fri Oct 22, 2010 2:49 pm

Recoler



What It Does
This function allows you to re-color any sprite, and set the transparency of the sprite as well.

How To Use
First, place the script in Global Code. Then when you want to use it, use this command:
Code: Select all
Recolor(R, G, B, Transp);

where R is the red color, G is green, B is blue, and Transp is how see-through he is.

Correct Format:
Code: Select all
Recolor(255, 255, 255, 0);




The code:
Place this in Global Code
Code: Select all
void Recolor(int R, int G, int B, double A)
{
    r = R;
    g = G;
    b = B;
    transp = A;
}









Screenshots:
recolor.JPG
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: Simple but useful functions - Recolor

Postby lcl » Fri Oct 22, 2010 3:25 pm

:D Nice simple code. :D
User avatar
lcl
 
Posts: 2339
Joined: Thu Mar 25, 2010 5:55 pm
Location: Finland
Score: 276 Give a positive score

Re: Simple but useful functions - Recolor

Postby Hblade » Fri Oct 22, 2010 4:25 pm

thx :P
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score


Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest