Fading a full screen sprite...

Blitz3D Forums/Blitz3D Programming/Fading a full screen sprite...

ICECAP(Posted 2004) [#1]
I have tried searching for something like this before but havnt found anything, i am sure i saw it somewhere, mabe someone can assist.

I need a an information screen to display (fade in) when i run over a certain "hotspot area" in my 3d village. I know you can do it by altering the alpha of a full screen sprite but i really have no idea of how to go about it (the making the 3d sprite fit the screen part).


BlackD(Posted 2004) [#2]
http://www.blitzbasic.co.nz/codearcs/codearcs.php?code=773


doctorskully(Posted 2004) [#3]
I have an easier way, I think.

Just load the sprite, make sure the viewmode is "always facing camera," and then do this: Position the sprite at your camera position, rotate the sprite just as your camera, and MoveEntity sprite,0,0,1. This will put it in front of your camera (make sure this is done each loop). Then, it's just the matter of setting up the variable alpha#, add something like .1 or .01 to it when it's fading in and subtract .1 or .01 while it's fading out. Just do EntityAlpha sprite,alpha# and bingo! Instant HUD (or whatever the sprite is).


gosse(Posted 2004) [#4]
or nSprite :D *plug*plug*

Simply scale it up to the screen size and fade it in with nS_ImageAlpha ;D


wizzlefish(Posted 2004) [#5]
the "Gamma" functions are wonderfully useful for fade-ins.