Homebrew DS Screen Fade In/Out Effects

Project68K

Well-Known Member
OP
Newcomer
Joined
Nov 12, 2020
Messages
66
Trophies
0
Age
23
XP
644
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?
 

Pk11

A catgirl with a DSi
Member
Joined
Jun 26, 2019
Messages
1,285
Trophies
1
Age
22
Location
米国
Website
pk11.us
XP
3,892
Country
United States
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();
}
 

Project68K

Well-Known Member
OP
Newcomer
Joined
Nov 12, 2020
Messages
66
Trophies
0
Age
23
XP
644
Country
United States
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?
 

Project68K

Well-Known Member
OP
Newcomer
Joined
Nov 12, 2020
Messages
66
Trophies
0
Age
23
XP
644
Country
United States
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

General chit-chat
Help Users
  • No one is chatting at the moment.
    Xdqwerty @ Xdqwerty: good night