Screensaver-modding-guide
What is the screensaver for the kernel?
The screensaver is the idle process that will activate if your computer went idle. You can also see the default screensaver by savescreen that is set by you or by the kernel.
The screensaver can also be customized, and we'll teach you how to make your first screensaver, to make from the simplest screensaver to legendary ones.
NOTE: Documentation renewal needed.
Basic modding (screensaver)
How to make your own screensavers on Visual Studio 2017?
Repeat steps 1-8 from the Modding guide
On the Compile section, click on Build Events, then write this on the Post-build event command line:
copy ..\..\ModFile.vb ..\..\..\..\ModFileSS.m
del /Q *.*Repeat steps 9-16 from the Modding guide, but replace the Imports KS.ModParser with Imports KS.Screensaver
Between the Public Class... and the End Class lines, let Visual Studio 2017 know that you're going to create your KS screensaver by writing:
Implements ICustomSaverIf you're going to add namespaces, these rules must be met:
Don't import KS by itself. KS does that automatically
When importing modules/classes like TextWriterColor, it's written like this:
Imports KS.TextWriterColor
Define properties for mod information by putting below the Implements IScript:
Make your init screensaver sub named InitSaver() that implements the ICustomSaver.InitSaver, by writing:
Replace every Your code here comment with your code. Repeat this step on all the interface subs
Make your pre-display (Called before displaying screensaver) sub named PreDisplay() that implements the ICustomSaver.PreDisplay, by writing:
Make your display code (it should display something) sub named ScrnSaver() that implements the ICustomSaver.ScrnSaver, by writing:
You can make your subs anywhere on the class, but if:
they're on the different class, press Enter on End Class and make a public new class that stores new subs:
12. Run the build. When the build is successful, ignore the dialog box that appears. 13. Run your Kernel Simulator you've just referenced to in your project, and load, set default, and lock your screen and your screensaver is there.
1. In-Console Message Box, and Soon, Overnight, or Rude (Go away...) messages
The back message box screensaver tells people that the computer owner is gone, or the owner tells that they should go away because there is important things going on in their computers. This is achieved in XLock in old Linux systems by putting 3 modes, Soon, Overnight, and Rude.
Right-click on the project, and go to Add > Class
Name your screensaver, but leave the .vb intact. Your mod name should be the one that is included in the Post-build built event. If your mod name is changed, you must also change the post-build event for the changes to be reflected.
Click Add, and the code will be ready.
Write below the (Assume that your mod name is SOR) Public Class SOR: Implements ICustomSaver
Write above the Public Class SOR:
You should get errors saying that these subs should be created.
Make your start screensaver event handler by writing:
Since we're not implementing anything before displaying screensaver, we're going to leave this blank:
Write above the Property Initialized...:
Write on the ScrnSaver() sub:
You may need to create 1 function and 2 subs for this to work. Write them below the last End Sub:
The code should look like this:
Run the build. When the build is successful, ignore the dialog box that appears.
Run your Kernel Simulator you've just referenced to in your project, and load, set as default, and run savescreen.
2. Simple Blank screen
Repeat the steps 1-4 on the first example: In-Console Message Box, and Soon, Overnight, or Rude (Go away...) messages
Write above the Public Class Blank (assuming that your classname is Blank):
Write these below the Implements ICustomSaver:
Repeat the steps 13-14 on the first example: In-Console Message Box, and Soon, Overnight, or Rude (Go away...) messages
3. Animation (Drawing Circle - 4 frames - 4 FPS)
This example will get you started with the animations. Copy-paste the code for remaining examples.
4. Calculate from 0 to 1,000,000 with progress bar (dynamic)
More examples
If you want to check out more examples, feel free to check them out in the KSModExamples respository on Screensavers folder in GitHub (not ready yet)
Last updated