Screen Savers

Blitz3D Forums/Blitz3D Beginners Area/Screen Savers

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.

All you have to do is rename the executable to "yournamehere.scr" and ignore the warning message. Also, you should check the command line when the program starts up, with /C being the options for the screensaver and /S being the actual screensaver:
If CommandLine$() <> "" Then                                ; If Parameter is present then 
  If Upper(Left$(CommandLine$(),2)) = "/C" Then Configure() ;  check if Screensaver Configuration shall be executed
  If Upper(Left$(CommandLine$(),2)) = "/S" Then Start()     ;  or Screensaver itself should be started  
EndIf


You should also put a delay(1) in the main loop to make sure that other programs running when the screensaver turns on still get cpu time. Also, you should terminate the main loop with any mouse movement, mouse press, or key press.

I think there is a tutorial somewhere on this site (where I got my info)

EDIT: couldn't find tutorial, here is a framework to add to:
ChangeDir SystemProperty$("appdir")

If CommandLine$() <> "" Then                                ; If Parameter is present then 
  If Upper(Left$(CommandLine$(),2)) = "/C" Then Configure() ;  check if Screensaver Configuration shall be executed
  If Upper(Left$(CommandLine$(),2)) = "/S" Then Start()     ;  or Screensaver itself should be started  
EndIf 

End

Function Configure() ;for settings button

;put your configure screen here
End Function   



Function Start()	;actual screen saver
FlushKeys()                   ; clean keyboardbuffer
FlushMouse()                  ; clean mousebuffer  
MoveMouse 0,0                 ; move mouse to 0,0 for later check

Graphics mode,mode,1

Repeat             ;main loop 

Cls    
Delay 1                       ; secure that the CPU usage is not 100% all time!	
Until GetMouse() <> 0 Or MouseX() <> 0 Or MouseY() <> 0 Or GetKey() <> 0 ; check if user makes a move :)

End Function