It is currently Sat Oct 31, 2020 8:14 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 48 posts ]  Go to page 1, 2, 3, 4  Next
Author Message
 Post subject: My First Screen Saver
PostPosted: Thu Dec 12, 2019 7:30 am 
Offline
Addict
Addict
User avatar

Joined: Sun Apr 27, 2003 8:12 am
Posts: 2075
Location: USA
Here's my first screen saver in PureBasic. PoseMotion Christmas! :D

V1.4.2
Download PoseMotion Christmas

Now with Installer that installs and uninstalls the screen saver!

Image

Screen Saver Template
Code:
InitSprite()
InitMouse()
InitKeyboard()

ExamineDesktops()

Global DPI.d = DesktopResolutionX()

UsePNGImageDecoder()

;***************Screen Saver Variables & Procedures (PBI)***************

  IncludeFile("Snow Procedure.pbi")

;***********************************************************************

Global ParameterID.s = "", hWnd, pSize.RECT

Procedure Callback(hWnd, Message, wParam, lParam)
 
  Protected Retval
 
  Select Message
    Case #WM_CLOSE
      End
  EndSelect

  Retval = DefWindowProc_(hWnd, Message, wParam, lParam)
 
  ProcedureReturn Retval
 
EndProcedure

Procedure Preview()
   
    hWnd = Val(ParameterID)
    GetClientRect_(hWnd, @PSize.RECT)
    If OpenWindow(0, 0, ((pSize\bottom / DPI) - (((pSize\right / DPI) / 16) * 9)) / 2, pSize\right / DPI, ((pSize\right / DPI) / 16) * 9, "", #WS_CHILD, hWnd)
      OpenWindowedScreen(WindowID(0), 0, 0, DesktopWidth(0) +110, DesktopHeight(0) -55, 1, 0, 0)
      SetWindowCallback(@Callback())
     
      SetWindowState(0, #PB_Window_Maximize) ;temp fix PureBasic 5.72
      SetWindowState(0, #PB_Window_Normal) ;temp fix PureBasic 5.72
    EndIf
   
    If IsSprite(1) = 0
     
;**********************Preview Catch File(s)(PBI)***********************

  IncludeFile("Snow Catch Files.pbi")

;***********************************************************************
 
    EndIf
   
    AddWindowTimer(0, 1, 16)

    Repeat
     
      ClearScreen(RGB(50, 100, 200))
       
        WaitWindowEvent()
       
;************************Preview Animation(PBI)*************************

  IncludeFile("Snow Preview Animation.pbi")

;***********************************************************************
     
      FlipBuffers()
   
    ForEver

EndProcedure
 
Procedure Settings()
 
;*************************Settings Window(PBI)**************************

  IncludeFile("Snow Settings Window.pbi")

;***********************************************************************
   
EndProcedure

Para.s = ProgramParameter()

Parameter.s = LCase(Left(ReplaceString(Para.s,"-","/"), 2))
 
  Select Parameter
    Case "/p"
      ParameterID = ProgramParameter()
      Preview()
    Case "/c"
      Settings()
    Case "/s"
   
;**Screen-Saver Screen, Catch File(s), Repeat Loop, & Animation (PBI)***

  IncludeFile("Snow Animation.pbi")

;***********************************************************************

  EndSelect
 
;********************Screen Saver Data Section (PBI)********************

  IncludeFile("Snow Data.pbi")

;***********************************************************************

_________________
www.posemotion.com

PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef

Mac: 10.13.6 / 1.4GHz Core 2 Duo / 2GB DDR3 / Nvidia 320M
PC: Win 7 / AMD 64 4000+ / 3GB DDR / Nvidia 720GT


Even the vine knows it surroundings but the man with eyes does not.


Last edited by J. Baker on Fri Sep 25, 2020 3:21 pm, edited 12 times in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: My First Screen Saver
PostPosted: Thu Dec 12, 2019 8:21 am 
Offline
Addict
Addict

Joined: Thu Apr 18, 2019 8:17 am
Posts: 1047
Nice, but the flakes fall too fast on my PC. Can they be slowed down in a future update?


Top
 Profile  
Reply with quote  
 Post subject: Re: My First Screen Saver
PostPosted: Thu Dec 12, 2019 1:35 pm 
Offline
Addict
Addict
User avatar

Joined: Sun Apr 27, 2003 8:12 am
Posts: 2075
Location: USA
Yes, I can do that. Sorry about that.

_________________
www.posemotion.com

PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef

Mac: 10.13.6 / 1.4GHz Core 2 Duo / 2GB DDR3 / Nvidia 320M
PC: Win 7 / AMD 64 4000+ / 3GB DDR / Nvidia 720GT


Even the vine knows it surroundings but the man with eyes does not.


Top
 Profile  
Reply with quote  
 Post subject: Re: My First Screen Saver
PostPosted: Thu Dec 12, 2019 2:05 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Apr 30, 2003 8:15 am
Posts: 1049
Location: Germany
Nice! It would be nice, if you could set your own picture as background. :)

_________________
"Daddy, I'll run faster, then it is not so far..."


Top
 Profile  
Reply with quote  
 Post subject: Re: My First Screen Saver
PostPosted: Thu Dec 12, 2019 3:12 pm 
Offline
Addict
Addict
User avatar

Joined: Sun Apr 27, 2003 8:12 am
Posts: 2075
Location: USA
Thanks! I will see what I can add. Adding a proper settings window now. Maybe some more graphics. I just added the source code template to the first post. It should be easy for anyone to edit/make their own screen savers. ;)

_________________
www.posemotion.com

PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef

Mac: 10.13.6 / 1.4GHz Core 2 Duo / 2GB DDR3 / Nvidia 320M
PC: Win 7 / AMD 64 4000+ / 3GB DDR / Nvidia 720GT


Even the vine knows it surroundings but the man with eyes does not.


Top
 Profile  
Reply with quote  
 Post subject: Re: My First Screen Saver
PostPosted: Thu Dec 12, 2019 3:22 pm 
Offline
Addict
Addict
User avatar

Joined: Sun Apr 27, 2003 8:12 am
Posts: 2075
Location: USA
BarryG wrote:
Nice, but the flakes fall too fast on my PC. Can they be slowed down in a future update?

I just fixed it. I hope. Let me know if it runs fine now. ;)

_________________
www.posemotion.com

PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef

Mac: 10.13.6 / 1.4GHz Core 2 Duo / 2GB DDR3 / Nvidia 320M
PC: Win 7 / AMD 64 4000+ / 3GB DDR / Nvidia 720GT


Even the vine knows it surroundings but the man with eyes does not.


Top
 Profile  
Reply with quote  
 Post subject: Re: My First Screen Saver
PostPosted: Thu Dec 12, 2019 10:52 pm 
Offline
Addict
Addict
User avatar

Joined: Sun Apr 27, 2003 8:12 am
Posts: 2075
Location: USA
Just added my Christmas 2019 screen saver to the original post above. This one has more graphics, animation, and a proper settings/about window. Still may add more to it. Enjoy and Merry Christmas! ;)

_________________
www.posemotion.com

PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef

Mac: 10.13.6 / 1.4GHz Core 2 Duo / 2GB DDR3 / Nvidia 320M
PC: Win 7 / AMD 64 4000+ / 3GB DDR / Nvidia 720GT


Even the vine knows it surroundings but the man with eyes does not.


Top
 Profile  
Reply with quote  
 Post subject: Re: My First Screen Saver
PostPosted: Fri Dec 13, 2019 8:18 am 
Offline
Addict
Addict

Joined: Thu Apr 18, 2019 8:17 am
Posts: 1047
J. Baker wrote:
I just fixed it. I hope. Let me know if it runs fine now. ;)

Nice; they're not as fast now, and I love the addition of the window and the Christmas tree! Thanks.


Top
 Profile  
Reply with quote  
 Post subject: Re: My First Screen Saver
PostPosted: Fri Dec 13, 2019 1:33 pm 
Offline
Addict
Addict
User avatar

Joined: Sun Apr 27, 2003 8:12 am
Posts: 2075
Location: USA
BarryG wrote:
Nice; they're not as fast now, and I love the addition of the window and the Christmas tree! Thanks.

Glad to hear. I'm going to add a calendar next and I think that will finish it up. :D

_________________
www.posemotion.com

PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef

Mac: 10.13.6 / 1.4GHz Core 2 Duo / 2GB DDR3 / Nvidia 320M
PC: Win 7 / AMD 64 4000+ / 3GB DDR / Nvidia 720GT


Even the vine knows it surroundings but the man with eyes does not.


Top
 Profile  
Reply with quote  
 Post subject: Re: My First Screen Saver
PostPosted: Fri Dec 13, 2019 1:45 pm 
Offline
Addict
Addict

Joined: Thu Apr 18, 2019 8:17 am
Posts: 1047
J. Baker wrote:
I'm going to add a calendar next

Please tell me it'll be an actual calendar with the current month, and not just a display one? Because a real one would be the icing on the cake!


Top
 Profile  
Reply with quote  
 Post subject: Re: My First Screen Saver
PostPosted: Fri Dec 13, 2019 4:16 pm 
Offline
Addict
Addict
User avatar

Joined: Sun Apr 27, 2003 8:12 am
Posts: 2075
Location: USA
BarryG wrote:
Please tell me it'll be an actual calendar with the current month, and not just a display one? Because a real one would be the icing on the cake!

It's real and the update is available to download now. ;)

_________________
www.posemotion.com

PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef

Mac: 10.13.6 / 1.4GHz Core 2 Duo / 2GB DDR3 / Nvidia 320M
PC: Win 7 / AMD 64 4000+ / 3GB DDR / Nvidia 720GT


Even the vine knows it surroundings but the man with eyes does not.


Top
 Profile  
Reply with quote  
 Post subject: Re: My First Screen Saver
PostPosted: Fri Dec 13, 2019 5:04 pm 
Offline
Addict
Addict
User avatar

Joined: Sun Apr 27, 2003 8:12 am
Posts: 2075
Location: USA
I forgot about the calendar updating at midnight. I just added it. New download available and I believe I'm done now. ;)

_________________
www.posemotion.com

PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef

Mac: 10.13.6 / 1.4GHz Core 2 Duo / 2GB DDR3 / Nvidia 320M
PC: Win 7 / AMD 64 4000+ / 3GB DDR / Nvidia 720GT


Even the vine knows it surroundings but the man with eyes does not.


Top
 Profile  
Reply with quote  
 Post subject: Re: My First Screen Saver
PostPosted: Fri Dec 13, 2019 5:50 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sat May 05, 2007 5:31 pm
Posts: 767
Location: Linz, Austria
Nice one, thanks!

A small note... When I right-click the .scr and click on "Configure", nothing is shown.

_________________
Et cetera is my worst enemy


Top
 Profile  
Reply with quote  
 Post subject: Re: My First Screen Saver
PostPosted: Fri Dec 13, 2019 5:57 pm 
Offline
Addict
Addict
User avatar

Joined: Sun Apr 27, 2003 8:12 am
Posts: 2075
Location: USA
chi wrote:
Nice one, thanks!

A small note... When I right-click the .scr and click on "Configure", nothing is shown.

I'll look into that but there's nothing to configure in this screen saver. I guess I could use some sort of message requester for that at the moment. Stating there's nothing to configure. Or link it to the Settings/About window.

_________________
www.posemotion.com

PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef

Mac: 10.13.6 / 1.4GHz Core 2 Duo / 2GB DDR3 / Nvidia 320M
PC: Win 7 / AMD 64 4000+ / 3GB DDR / Nvidia 720GT


Even the vine knows it surroundings but the man with eyes does not.


Top
 Profile  
Reply with quote  
 Post subject: Re: My First Screen Saver
PostPosted: Fri Dec 13, 2019 7:21 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sat May 05, 2007 5:31 pm
Posts: 767
Location: Linz, Austria
Oh, I always thought that "Configure" and "Settings..." opens the same window?! It's been a while since I last used a screensaver ;)

_________________
Et cetera is my worst enemy


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 48 posts ]  Go to page 1, 2, 3, 4  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye