Fade to black

Blitz3D Forums/Blitz3D Programming/Fade to black

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

check out my screentransition lib... composed out of demos i gathered and wrote...

http://www.balpoint.com/files//tek%20demos/ScreenTransition.Archive.Demo.exe

Source included....

also this is simple source for fading


P.S *For the smart ones...* I loved the album!
Function Fader(Image$,FadeToRGB,Pause)

		Local Camera = CreateCamera()
		CameraClsMode Camera,0,1
		Local FadeSprite = CreateSprite()
		EntityColor FadeSprite,Left$(FadeToRGB,3),Left$(Mid$(FadeToRGB,4),3),Right$(FadeToRGB,3)
		MoveEntity FadeSprite,0,0,1
		EntityOrder FadeSprite,-100

		Local Logo =  LoadImage(Image$)
		Local FadeIn = False
		Local FadeOut = False
		Local FadeLevel# = 1
		Local Done = False
		Local Timer = 0
	
		While Done = False
			Timer = Timer + 1
		
			If Timer = 100
				FadeIn = True
			EndIf
			
			Cls

			DrawImage Logo,(GraphicsWidth()/2)-(ImageWidth(Logo)/2),(GraphicsHeight()/2)-(ImageHeight(Logo)/2)
			
			If FadeIn = True
				EntityAlpha FadeSprite,FadeLevel#
				FadeLevel# = FadeLevel# - .01
				If FadeLevel# <= 0
					FadeLevel# = 0
					FadeIn = False
				EndIf
			EndIf
		
			If FadeOut = True
				EntityAlpha FadeSprite,FadeLevel#
				FadeLevel# = FadeLevel# + .01
				If FadeLevel# => 1
					FadeLevel# = 1
					Done = True
				EndIf
			EndIf		
		
			If GetKey() Or GetJoy() Or Timer >= Pause
				FadeIn = False
				FadeOut = True
			EndIf
		
			RenderWorld
			Flip
		Wend	
		FreeEntity FadeSprite
		FreeEntity Camera
		FreeImage Logo
	End Function