A different kind of fade

Talk about things that are not making games here. But you should also make games!

Moderators: Bob the Hamster, marionline, SDHawk

Post Reply
AzureGames
Red Slime
Posts: 49
Joined: Thu Oct 29, 2015 8:18 pm

A different kind of fade

Post by AzureGames »

How do you make the screen darken? Sorry in advance if you don't understand the question.
User avatar
Feenicks
Metal Slime
Posts: 697
Joined: Tue Aug 10, 2010 9:23 pm
Location: ON THE AIR IN THE AIR
Contact:

Post by Feenicks »

Hmm. There's two ways I can read this question.
The first is that you just want the screen to fade to black; if that's the case, just do:

Code: Select all

fade screen out
The second is that you want the screen to just be darkened. This is a bit more involved, but not hugely so:

Code: Select all

tweak palette(r,g,b)
#where the r,g,b values are each some value from 0 to -63, depending on how much you want the palette to be shifted in the red/green/blue direction
#if you want a more gradual shift, do:
fade screen in
#if you want an instant change, do:
update palette
#and when you want to reset the palette in question:
reset palette
If you're going this second method, it might be smart to organize your palette such that the color indexes the UI elements are using are separated out from the rest of the colors. If you go this route, the tweak palette() command has two extra additional values you can use to define what colors are being adjusted:

Code: Select all

tweak palette(r,g,b,first palette index,last palette index)
Post Reply