Thsfx
From ProjectWiki
NDS special effect library
Contents |
What is this?
This is a simple library for controlling special effects functions in the form of macros for the Nintendo DS's sprite and background hardware. These functions are available for both screens.
Where do i get it?
Currently the sources for this are part of LibThds. The source can be downloaded via SVN (see libthds page) or directly from the svn httpd:
Okay I'm convinced. Let's put it to atcion.
Examples
Fadeout
Fade screen 0 to black.
thSfxEnable(0, SFX_BRIGHTDEC, SFX_BG0|SFX_BG1|SFX_BG2|SFX_BG3|SFX_OBJ|SFX_BD, SFX_NONE); int fade=0; do { thSfxSetBrightness(0, fade); swiWaitForVBlank(); } while(++fade<=SFX_MAX);
Fade to White
Fade screen 1 to White slowly.
thSfxEnable(1, SFX_BRIGHTINC, SFX_BG0|SFX_BG1|SFX_BG2|SFX_BG3|SFX_OBJ|SFX_BD, SFX_NONE); int fade=0; do { thSfxSetBrightness(1, fade>>2); swiWaitForVBlank(); } while(++fade<=(SFX_MAX<<2));
Blend backgrounds with sprites
Blend sprites evenly with backgrounds
thSfxEnable(0, SFX_BRIGHTINC, SFX_OBJ, SFX_BG0|SFX_BG1|SFX_BG2|SFX_BG3|SFX_BD); thSfxSetAlphaBlend(0, 15, 15);