How to change alpha of every object?

M

MercuryRich123

Guest
For a test I decided to try make a cave like system, however, I don't know how to make every 'outside' object of the cave go slightly dimmed so it looks like the player is inside the cave. I know how to use
Code:
image_alpha = 1;
but I don't know how to apply it every object. Thanks for any help.
 

Roderick

Member
if there are things that you don't want to dim, give those objects a variable called dont_dim and set it to true. Then
Code:
with (all)
{
 if is_undefined(dont_dim)
 {
  image_alpha = 0.5;
 }
}
 

FrostyCat

Member
if there are things that you don't want to dim, give those objects a variable called dont_dim and set it to true. Then
Code:
with (all)
{
 if is_undefined(dont_dim)
 {
  image_alpha = 0.5;
 }
}
I hate it when people advise using things like is_undefined() and ds_exists() to do what isset() does in PHP. They can't unless that variable is initialized to undefined (for is_undefined()) or -1 (for ds_exists()). They still cause unknown variable errors if that isn't done.
 

Coded Games

Member
Another method would be to make all the objects you want to dim a child of some parent object, for example obj_dimmable.

Then you're code would just be:

Code:
with (obj_dimmable) {
    image_alpha = 0.5;
}
Also another thing you could do is change their image_blend to some shade of gray so, along with being somewhat transparent, they are also darker.
 
Top