Homebrew DS Screen Fade In/Out Effects

  • Thread starter Thread starter JoeySyntax
  • Start date Start date
  • Views Views 1,157
  • Replies Replies 4

JoeySyntax

Well-Known Member
Member
Joined
Nov 12, 2020
Messages
112
Reaction score
84
Trophies
1
Age
26
XP
1,188
Country
United States
I've been attempting to experiment with adding a fade in/fade out effect to the screen whenever the game state is switched. I have attempted to implement this by using the NF_BG_BGEditPalColor(), and NF_BG_SetPalColor() functions respectively. It kind of works, but not the way that I would have hoped.

Does anyone have a good example of how to do this?
 
If you just want to fade to black or white you can just use the screen brightness registers. libnds has the setBrightness() function for it, just do like:
C:
// Fade to white
for(int i = 0; i <= 16; i++) {
    setBrightness(3, i);

    // Waiting just one frame would probably be a bit fast, can experiment with the timing
    swiWaitForVBlank();
    swiWaitForVBlank();
}
 
If you just want to fade to black or white you can just use the screen brightness registers. libnds has the setBrightness() function for it, just do like:
C:
// Fade to white
for(int i = 0; i <= 16; i++) {
    setBrightness(3, i);

    // Waiting just one frame would probably be a bit fast, can experiment with the timing
    swiWaitForVBlank();
    swiWaitForVBlank();
}
Wouldn't that have an effect on the screen brightness if let's say the player changed the brightness setting in the DS Menu?
 
No, that's a different brightness. This simply refers to how black/white the screens are, not the actual backlight brightness.

I see. I appreciate the help. It took me so long just to find out it all came down to a simple function.
 

Site & Scene News

Popular threads in this forum