Blitz ScreenSaver Help

Blitz3D Forums/Blitz3D Programming/Blitz ScreenSaver Help

It's not *quite* as simple as that I'm afraid.

Here's a crusty old B2D screensaver example from the dark ages...
;*************************************************
;**** First Attempt At (Crap) Screen Saver
;**** YAN May 2001
;*************************************************
;
;Rename the executable from ????.exe To ????.scr
;
AppTitle "Blitz Screen Saver Config"

in$=Upper(CommandLine$())

Global screenx=640 													;
Global screeny=480													;Probably read these from a config file
Global screendepth=16												;

If Instr(in$,"S") Then StartSaver()									;Test/Preview/Timeout Call

If in$="" Or Instr(in$,"C") Then ConfigSaver(in$)						;Configure/Settings Call

End

Function StartSaver()												;Run the screensaver code
	Graphics screenx,screeny,screendepth
	
	SetBuffer BackBuffer()
	
	FlushKeys
	FlushMouse
	
	x=MouseX()
	y=MouseY()
	
	SeedRnd MilliSecs()  
    Color Rnd(255),Rnd(255),Rnd(255)
	cs=(screenx Shr 5)
	cx=(screenx Shr 1)
	cy=(screeny Shr 1)
	sx=Rnd(1,4):sy=Rnd(1,4)
	Repeat
		Cls
		Oval cx,cy,cs,cs,1
		Flip
		cy=cy+sy:cx=cx+sx
		If cx<=0 Or cx>=(screenx-cs) Then sx=-sx
		If cy<=0 Or cy>=(screeny-cs) Then sy=-sy
	Until GetMouse() Or GetKey() Or y<>MouseY() Or x<>MouseX()
End Function

Function ConfigSaver(cl$)												;Set up saver properties and 
	Graphics 300,300,0,2									;probably save to a config file
	
	SetBuffer FrontBuffer()
	
	Text 0, 0, cl$
	
	Text 100,100,"Configure Me"
		
	Repeat
		If RectsOverlap(120, 210, 60, 30, MouseX(), MouseY(), 1, 1);MouseX()>120 And MouseX()<180 And MouseY()>210 And MouseY()<240
			Color 0,0,200
			Rect 120,210,60,30,1
			Color $ff,$ff,$ff
			Text 133,218,"EXIT"
			If MouseDown(1) Then click=True
		Else
			Color 100,0,200
			Rect 120,210,60,30,1
			Color $ff,$ff,$ff
			Text 133,218,"EXIT"
			click=False
		EndIf
	Until click
End Function

There's a much better example in the code archives (see my profile) but it's written in BMax.