Posted: 18th Oct 2021 0:45
Hi,
For the life of me I have tried numerous ways to have only a sprite splash screen show for about 5 seconds. All I get is a white screen for about 5 seconds and then it and everything else shows up at the same time. I have loaded an image, created the sprite and set the position of the sprite all before what I have tried to pause the program so the splash shows for 5 seconds, but, like I said above I get a white screen for 5 seconds and then program continues as normal.

+ Code Snippet
LoadImage(3, "UFMSplash.png")
CreateSprite ( 1, 3 )
SetSpritePosition(1, 25, 75)

Repeat
     Time# = Timer()
Until Time# = 5


The timer works, but I get white screen for 5 seconds. I have also tried other ways, but same thing happends. The above code and the other ways I tried, I put after loading image, creating sprite and setting the position of sprite.
Posted: 18th Oct 2021 1:22
this is (pretty much) how i did it in P3:
+ Code Snippet
Function DoSplash()
	ThisAlpha = 0
	SetSpriteColorAlpha(Splash,ThisAlpha)
	SetSpriteVisible(Splash,1)
	SplashTimer# = Timer() 

	Repeat
		ThisAlpha = ThisAlpha + 2
		If ThisAlpha > 255 then ThisAlpha = 255
		SetSpriteColorAlpha(Splash, ThisAlpha )
		Sync()
	Until GetPointerPressed() = 1 or Timer() > SplashTimer# + 5

	SetSpriteVisible(Splash,0)
EndFunction

can do a "fade out" similarly (or get rid of the alpha part altogether).

or, just a 5 sec pause:
+ Code Snippet
Start# = Timer()
Repeat
     Sync()
Until Start# + 5 <= Timer()
Posted: 18th Oct 2021 1:48
or, just a 5 sec pause:


Thank you Virtual Nomad, your 2nd snippet worked.

I knew I was on the right track with my code, but I think I was just missing a sync() command
Posted: 18th Oct 2021 1:58
Setup.agc can also also be used to set AppGameKit values so you don't see that initial blank window
Posted: 18th Oct 2021 2:52
This is what I'm doing in my loop, I will try Virtual Nomads. Mine works good but I want it to fade if possible.


+ Code Snippet
if crlscreen=0
SetSpriteVisible(5000,1)	
SetSpriteDepth(5000,0)
if connected=0 then SetVirtualButtonVisible(1,0)
if connected=0 then SetVirtualButtonVisible(2,0)
if connected=0 then SetVirtualButtonVisible(3,0)
if connected=0 then SetVirtualButtonVisible(4,0)
if connected=0 then SetVirtualButtonVisible(5,0)
if connected=0 then SetVirtualButtonVisible(6,0)
if connected=0 then SetVirtualButtonVisible(7,0)
if connected=0 then SetVirtualButtonVisible(8,0)
if connected=0 then SetVirtualButtonVisible(9,0)
if connected=0 then SetVirtualButtonVisible(10,0)
if connected=0 then SetVirtualButtonVisible(11,0)
if connected=0 then SetVirtualButtonVisible(12,0)
countscreen=countscreen+1
endif

if GetHurt=0 and crlscreen=1
SetSpriteVisible(5000,0)	
if connected=0 then SetVirtualButtonVisible(1,1)
if connected=0 then SetVirtualButtonVisible(2,1)
if connected=0 then SetVirtualButtonVisible(3,1)
if connected=0 then SetVirtualButtonVisible(4,1)
if connected=0 then SetVirtualButtonVisible(5,1)
if connected=0 then SetVirtualButtonVisible(6,1)
if connected=0 then SetVirtualButtonVisible(7,1)
if connected=0 then SetVirtualButtonVisible(8,1)
if connected=0 then SetVirtualButtonVisible(9,1)
if connected=0 then SetVirtualButtonVisible(10,1)
if connected=0 then SetVirtualButtonVisible(11,1)
if connected=0 then SetVirtualButtonVisible(12,1)
endif

if countscreen=>100 
SetSpriteVisible(5000,0)	
crlscreen=1
countscreen=0	
endif