how can I dark a room??

Started by Nahuel, Mon 03/08/2009 19:45:13

Previous topic - Next topic

Nahuel

Hello, my question is, how can I put in dark a room and when the char touch the switch restore the light.??

Thanks for your time!

Nahuel.
Life isn't a game. Let's develop a life-like-game.

Ethan D

#1
I would recommend using a GUI that is the size of the screen, set the background color of the GUI to black or dark gray.  

Then have a script for when the light it on the GUI's transparency to 100%

If the light is off set the GUI's transparency to a high percentage.  This will make the whole room darker.

Matti

You can make two background pictures and use SetBackgroundFrame to switch between the bright and the dark image.

Nahuel

Quote from: Float On on Mon 03/08/2009 19:50:18
I would recommend using a GUI that is the size of the screen, set the background color of the GUI to black or dark gray.  

Then have a script for when the light it on the GUI's transparency to 100%

If the light is off set the GUI's transparency to a high percentage.  This will make the whole room darker.
Quote from: Mr Matti on Mon 03/08/2009 19:53:50
You can make two background pictures and use SetBackgroundFrame to switch between the bright and the dark image.

Thank you very much for help me!

Nahuel.

PD. I still try other ways!  :=

Life isn't a game. Let's develop a life-like-game.

Ethan D

Quote from: Mr Matti on Mon 03/08/2009 19:53:50
You can make two background pictures and use SetBackgroundFrame to switch between the bright and the dark image.

The problem with that method is if it's a room there are probably objects in it which won't change with the background so the object will remain the color of the light being on, so you would need to make multiple objects of different brightnesses in order to create the effect.  Also it makes it much harder to animate anything in the background.

With the GUI its just a few simple codes, and no extra backgrounds to make.  The only disadvantage to the GUI method is that the dimming of the room will be constant.  If you want to have the room fade to darkness on the edges you should use SetBackgroundFrame.

Nahuel

Quote from: Float On on Mon 03/08/2009 20:00:06
Quote from: Mr Matti on Mon 03/08/2009 19:53:50
You can make two background pictures and use SetBackgroundFrame to switch between the bright and the dark image.

The problem with that method is if it's a room there are probably objects in it which won't change with the background so the object will remain the color of the light being on, so you would need to make multiple objects of different brightnesses in order to create the effect.  Also it makes it much harder to animate anything in the background.

With the GUI its just a few simple codes, and no extra backgrounds to make.  The only disadvantage to the GUI method is that the dimming of the room will be constant.  If you want to have the room fade to darkness on the edges you should use SetBackgroundFrame.

Mmmm I think the same thing, I try to make a GUI and set Transparency and Color etc.

Thanks again!!

Nahuel.
Life isn't a game. Let's develop a life-like-game.

Snake

Wait just a moment.

Matti's way is perfectly fine. All you'd have to do for characters and objects is make a region on over the room area and adjust the lighting level when the player turns the light off.

Make sure you have "UseRoomAreaLighting" switched to true for your objects and all characters in that room.

Another way could be if you just switched sprites for your objects, but... bah.
Grim: "You're making me want to quit smoking... stop it!;)"
miguel: "I second Grim, stop this nonsense! I love my cigarettes!"

Nahuel

Quote from: Snake on Tue 04/08/2009 14:33:51
Wait just a moment.

Matti's way is perfectly fine. All you'd have to do for characters and objects is make a region on over the room area and adjust the lighting level when the player turns the light off.

Make sure you have "UseRoomAreaLighting" switched to true for your objects and all characters in that room.

Another way could be if you just switched sprites for your objects, but... bah.

This is very interesting! Thanks Snake!!

Nahuel.
Life isn't a game. Let's develop a life-like-game.

monkey0506

I think Nahuel is referring to the same question he posed here. I still hold that the same answer is the best method, I just told him the wrong place to call it.

There is a FadeOut function (maximum value 64 for instantaneous fade) to do exactly this. Of course if you call it in the "before fade-in" event then the engine is going to fade in and the function call won't do anything...calling it in "after fade-in" or anyplace after that point should work fine.

Nahuel

Quote from: monkey_05_06 on Tue 04/08/2009 20:02:03
I think Nahuel is referring to the same question he posed here. I still hold that the same answer is the best method, I just told him the wrong place to call it.

There is a FadeOut function (maximum value 64 for instantaneous fade) to do exactly this. Of course if you call it in the "before fade-in" event then the engine is going to fade in and the function call won't do anything...calling it in "after fade-in" or anyplace after that point should work fine.

Monkey, this is for a diferent thing, is a dark room but without your excelent module. Thanks for the answers Monkey!! I appreciate too much you time!  :=

Thanks.

Nahuel.
Life isn't a game. Let's develop a life-like-game.

SMF spam blocked by CleanTalk