QB64.org Forum
Active Forums => QB64 Discussion => Topic started by: thesolarcode on December 09, 2018, 12:22:34 pm
-
For a simple game, I'd like to start it with fading out the desktop.
I have some code which nearly does what I want, but it blinks ugly - maybe someone can help me.
_PUTIMAGE (0, 0)-(screenx
-1, screeny
-1), img&
' Fade out
_PUTIMAGE (0, 0)-(screenx
-1, screeny
-1), img&
LINE (0, 0)-(screenx
-1, screeny
-1), _RGBA(0, 0, 0, i%
), BF
'increase black box transparency
-
Why do you have sleep before fadeout?
Never mind.
The blink is the program starting up. It might be less if _limit put after display instead of before ie
update THEN display THEN delay.
-
I added the sleep to see where the blinking is happening.
I thought first it blinks due to the program startup, but on my PC there is some ugly blink right after the 3 second sleep (actually it looks like the fade out starts with a black image/screen), and at that time I would guess it is not anymore caused by any startup or setup of the screen.
I tried to move the _limit to after display as you suggested, but don't see any difference.
-
Sometimes my system locks up with _FULLSCREEN, so I tested it this way and added $SCREENHIDE and $SCREENSHOW...
'_FULLSCREEN
_PUTIMAGE (0, 0)-(screenx
- 1, screeny
- 1), img&
' Fade out
_PUTIMAGE (0, 0)-(screenx
- 1, screeny
- 1), img&
LINE (0, 0)-(screenx
- 1, screeny
- 1), _RGBA(0, 0, 0, i%
), BF
'increase black box transparency
_SCREENMOVE -5, -25
That statement centers it over my desktop, perfectly at 1366 x 768 desktop resolution. The -25 moves the QB64 title bar off the screen.
Try it with _FULLSCREEN, too. Just unremark it.
Oh, I came back to edit out that _DELAY .1. It turns out it will work without any delay.
Pete
-
I don't see difference either, I think now it is _FULLSCREEN that causes the blink.
What if you went from black to the image you want, a fade in so the blackout works for you.
Pete's code works better for me.
-
Wow, Pete's code works much better, seems like the _FULLSCREEN is the issue.
I can live with the short blink at the start.
Thanks :)
-
Wow, Pete's code works much better, seems like the _FULLSCREEN is the issue.
I can live with the short blink at the start.
Thanks :)
Well, the quote definitely looks better in FULLSCREEN. :D
Pete
-
I can confirm Pete experience
this code without _FULLSCREEN works well with a bit flickering at the start... just a little
in the while with _FULLSCREEN the flickering is like an heartquake!
_PUTIMAGE (0, 0)-(screenx
- 1, screeny
- 1), img&
' Fade out
_PUTIMAGE (0, 0)-(screenx
- 1, screeny
- 1), img&
LINE (0, 0)-(screenx
- 1, screeny
- 1), _RGBA(0, 0, 0, i%
), BF
'increase black box transparency
the results seem the same also in this manner...
also my Notebook screen is set to 1366x768 and I need to move screen to -1 , -26 to hide title bar and left border of window.
let me say: Exellent tip Pete!
-
Thank you. Some of this non-SCREEN 0 stuff is fun at times. If you're up to some really crazy stuff, have a look at my Firefox session manager app: https://www.qb64.org/forum/index.php?topic=860.0
Pete