Page 1 of 2

color changing

PostPosted: Fri Nov 14, 2008 8:18 pm
by j2graves
I just thought I'd try and be helpful for once, so I made a demo on how to make colors change in a loop. I figured this one out for myself and I made it full screen for no reason.

Re: color changing

PostPosted: Fri Nov 14, 2008 8:26 pm
by Kalladdolf
nice, very handy method for menu backgrounds.

Re: color changing

PostPosted: Sat Nov 15, 2008 3:35 pm
by j2graves
hasn't ANYONE else tried it?!

Re: color changing

PostPosted: Sat Nov 15, 2008 8:40 pm
by Kalladdolf
it is frustrating, isn't it?
new demos get buried by other old demos which are being bumped continuously and you begin to wonder why to even post.
My GE lightening effect got only 2 replies before it died.

Peoples, it doesn't hurt to post a comment, what you think, what you'd suggest, what you like, what you don't like, what you don't understand.
This demo has been downloaded 5 times. Kay, there should be exactly 5 replies. J2graves would be happy and my feelings exactly.

Re: color changing

PostPosted: Sun Nov 16, 2008 12:20 am
by pyrometal
The effect is pretty smooth and I like it! I recall using something like this somewhere before... Anyway, good work, this could be helpful to someone who wants ambient effects in their game.

--pyro

Re: color changing

PostPosted: Sun Nov 16, 2008 10:15 pm
by j2graves
thank you =D

Re: color changing

PostPosted: Sun Nov 23, 2008 10:50 pm
by j2graves
I posted this trying to be helpful but everyone is ignoring this!

Re: color changing

PostPosted: Mon Nov 24, 2008 1:09 am
by pyrometal
It happens a lot around here you know, which does suck unfortunately...

Re: color changing

PostPosted: Sat Dec 06, 2008 10:27 pm
by j2graves
that's too bad. by the way, I forgot to celebrate my 1000th post. YAY! there. this is actually my 1010th post

Re: color changing

PostPosted: Sat Feb 07, 2009 4:30 am
by jimmynewguy
hey pretty neat, i just might end up using this in my game.... :D

Re: color changing

PostPosted: Sun Feb 08, 2009 1:58 am
by j2graves
finally someone noticed! =D

Re: color changing

PostPosted: Sun Feb 08, 2009 2:08 am
by DST
its good, you have the concept right, but let me throw this one at you;

draw actor:
r=rlaser[0];
g=rlaser[1];
b=rlaser[2];

Now for the event, timer, whatever: (where limiter is actor integer, torq is global integer).

Code: Select all
int j;
    switch(limiter){
    case 0:
    rlaser[1]+=torq;
    if(rlaser[1]>=255){
        limiter+=1;}
    break;
    case 1:
    rlaser[0]-=torq;
    if (rlaser[0]<=0){
        limiter+=1;}
    break;
    case 2:
    rlaser[2]+=torq;
    if(rlaser[2]>=255){
        limiter+=1;}
    break;
    case 3:
    rlaser[1]-=torq;
    if (rlaser[1]<=0){
        limiter+=1;}
    break;
    case 4:
    rlaser[0]+=torq;
    if(rlaser[0]>=255){
        limiter+=1;}
    break;
    case 5:
    rlaser[2]-=torq;
        if (rlaser[2]<=0){
        limiter=0;}
    break;
 
 
 
 
    }
for (j=0; j<3; j++){
if(rlaser[j]<0){rlaser[j]=0;}
              }



The loop prevents any of the colors from being less than 0, and the variable 'torq' allows you to control the speed of the fade.

Also, these colors, (by using 255 as a max) always maintain maximum brightness and saturation. No greys or browns allowed. That part is very similiar to yours, just that you used 200.


What we do is step thru the colors, if a color reaches 255, the previous color declines; when the previous color is 0, the next color increases; and when the next color reaches 255, the current one decreases, and so on.

Re: color changing

PostPosted: Sun Feb 08, 2009 2:51 am
by j2graves
thanx for that. glad to see there's finally some conversation coming out of this topic.

Re: color changing

PostPosted: Thu Feb 12, 2009 7:42 pm
by j2graves
and it's forgotten again...

Re: color changing

PostPosted: Thu Feb 12, 2009 8:58 pm
by jimmynewguy
not as bad as mine though http://game-editor.com/forum/viewtopic.php?f=6&t=6463 50 downloads 1 reply.....