Problem with Fading in & out Window?

Blitz3D Forums/Blitz3D Programming/Problem with Fading in & out Window?

Guy Fawkes(Posted 2016) [#1]
Hi all. I have a small problem with Fading in a window. I can Fade the program's Window OUT just fine. The problem I'M having is with Fading in the program window while it's hiding so it smoothly transitions in from black fade in.

This requires User32.decls be in your 'Blitz3D/Userlibs folder

FadeTest.bb:



Thanks alot! :)

~GF


Flanker(Posted 2016) [#2]
There is a problem with your constants :
AW_SLIDE = AW_HOR_NEGATIVE
AW_ACTIVATE = AW_HOR_NEGATIVE
AW_BLEND = AW_VER_NEGATIVE

Try this :
Const AW_SLIDE = $40000
Const AW_ACTIVATE = $20000
Const AW_BLEND = $80000
Const AW_HIDE = $10000
Const AW_CENTER = $00010
Const AW_HOR_POSITIVE = $00001
Const AW_HOR_NEGATIVE = $00002
Const AW_VER_POSITIVE = $00004
Const AW_VER_NEGATIVE = $00008

Graphics 800,600,32,2
SetBuffer BackBuffer()

Repeat

	; Fade out
	api_AnimateWindow(SystemProperty$("AppHWND"),1500,AW_HIDE Or AW_BLEND)
			
	; Fade in
	api_AnimateWindow(SystemProperty$("AppHWND"),1500,AW_BLEND)
	
Until KeyHit(1)

End



Guy Fawkes(Posted 2016) [#3]
Thanks, Flanker. But I want it to FIRST fade in from nothing.

FadeTest.bb:



~GF


Guy Fawkes(Posted 2016) [#4]
So basically, the window should be invisible. Then it should slowly Fade In.


Guy Fawkes(Posted 2016) [#5]
I've now tried every possible combo of variables to try & make the window fade in. To no avail.

~GF


Guy Fawkes(Posted 2016) [#6]
Can someone please help me with a small example of first fading in with a hidden window, then fading out with a visible window?

Thank You!

~GF


RemiD(Posted 2016) [#7]
If you already have a function to set the transparency of the window, this may help : http://www.blitzbasic.com/codearcs/codearcs.php?code=3022


Guy Fawkes(Posted 2016) [#8]
How does that help with my current situation?

~GF


RemiD(Posted 2016) [#9]
The fading in fading out part... (if by "fading in" you mean increasing the window alpha until it is fully opaque and by "fading out" you mean decreasing the window alpha until it is fully transparent)


Guy Fawkes(Posted 2016) [#10]
Right.