how do you changed Brightness/Contrast

Non-platform specific questions.

how do you changed Brightness/Contrast

Postby dekoomer » Sun May 10, 2009 7:49 pm

i have a game and when my Main character hits a Monster i like the monster Brighten like almost
to white then dim back to it's original state, but i don't know how to do any of this, and i don't want to changed the animation itself
dekoomer
 
Posts: 8
Joined: Fri Sep 28, 2007 7:47 pm
Score: 0 Give a positive score

Re: how do you changed Brightness/Contrast

Postby skydereign » Sun May 10, 2009 7:54 pm

The only way to do this, I think, is to start with a bright image. So your sprite should be increased in brightness, then the actor's rgb should be lowered. That way, when you want it to brighten, increase the rgb. I don't think you can do contrast.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: how do you changed Brightness/Contrast

Postby dekoomer » Sun May 10, 2009 8:29 pm

Where can i change the charater rgb?
dekoomer
 
Posts: 8
Joined: Fri Sep 28, 2007 7:47 pm
Score: 0 Give a positive score

Re: how do you changed Brightness/Contrast

Postby skydereign » Sun May 10, 2009 8:44 pm

The rgb are actor variables. To manipulate them, you would use the script editor. Since you want the actor to initally be dim, set an event, Create Actor, and put Script Editor.
Hero->CreateActor->Script Editor
Code: Select all
r=127;
b=127;
g=127;

If you didn't know, the rgb values go from 0-255. So upon collision, set the values to 0. In the DrawActor event, you would put this
Hero->DrawActor->Script Editor
Code: Select all
if(r>127)
{
  r--;
  g--;
  b--;
}


Be warned, this will not do contrast, so you will lose quality, pending on the detail of your sprite. But if you don't care for any potential contrast loss, this should work. The red green blue values are really better for dimming a picture, so you should start with a bright pic, instead of making your pics brighter. That way you should be happy with the style.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: how do you changed Brightness/Contrast

Postby dekoomer » Sun May 10, 2009 9:37 pm

THANK YOU!!

**==SOOO MUCH==**

i love people like you
dekoomer
 
Posts: 8
Joined: Fri Sep 28, 2007 7:47 pm
Score: 0 Give a positive score

Re: how do you changed Brightness/Contrast

Postby jimmynewguy » Sun May 10, 2009 10:54 pm

dekoomer wrote:i love people like you

then you'll love these forums :lol:
Working on a probably too ambitious project! Wild-west-adventure-RPG-shooter-thing.
User avatar
jimmynewguy
 
Posts: 1137
Joined: Sat Mar 31, 2007 6:27 pm
Score: 89 Give a positive score

Re: how do you changed Brightness/Contrast

Postby Hblade » Thu May 28, 2009 4:55 am

Brightness, make a white image, then change the transparency of the image. The more transparent it is, the less brightness it will be. Same method with darkness, use a black image.
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: how do you changed Brightness/Contrast

Postby BlarghNRawr » Mon Jun 01, 2009 2:06 am

or make a white actor and use the rgb to change it to the desired darkness
Download Game Music
current projects:
Bold! ?% Started mechanics
Unnamed puzzle game 60% --i need a name!--
User avatar
BlarghNRawr
 
Posts: 767
Joined: Wed Jun 25, 2008 12:36 am
Location: Not using G-E anymore. Now using Source SDK.
Score: 27 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron