Coder Social home page Coder Social logo

particles.net's Introduction

particles.NET

When I saw this or this it looked so cool that I wanted it as screensaver.

If you want the same screensaver as the one shown on the GIF then you can download the defautScreenSaver.scr file added to this repository. Once downloaded you can right click on it and to choose install.

Create screensaver from the code

  • Open the solution
  • Set Visual Studio to release
  • Build
  • Go to the release folder where the .exe is
  • Replace the .exe with .scr
  • Right click on the .scr and choose install

Options

You can change the global parameters to customize it.

private const int Threshold = 200;
private const int NumberOfParticles = 100;
private const int RefreshSpeed = 33;
private Color _color = Color.FromArgb(0, 82, 148, 226);
private readonly Brush _backgroundColor = new SolidColorBrush(Color.FromRgb(48, 54, 66));
  • Threshold: distance in pixels in which the lines start to be visible
  • NumberOfParticles: self-explainatory
  • RefreshSpeed: The time between frames in ms
  • _color: color of the lines and particles
  • _backgroundColor: color of the canvas

Advanced

If you don't like dots but want to have other shapes such as a star then you can create a new class which extends to this interface:

public interface IParticle {
    void Update();
    Shape Form { get; }
    Point Position { get; }
    int Size { get; }
}

Once done you only have to change this:

var particles = Enumerable.Range(0, NumberOfParticles).Select(element => new Particle(random, _color)).ToList();

To:

var particles = Enumerable.Range(0, NumberOfParticles).Select(element => new YOURCUSTOMCLASS(...)).ToList();

particles.net's People

Contributors

dugagjin avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

lgm-adrianhum

particles.net's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.