Code Monkey home page Code Monkey logo

p5.anims's Introduction

p5.animS

p5.animS animates p5.js shapes by rendering their drawing processes.

Demo

See https://wixette.github.io/p5.animS/ for the documentation and the examples.

Or

npm install
npm run build
npx http-server

then visit http://127.0.0.1:8080 to read the documentation.

Getting Started

In your HTML code, put p5.anims.js right after p5.js or p5.min.js, followed by your sketch code:

<body>
    <main>
    </main>
    <script src="p5.min.js"></script>
    <script src="p5.anims.js"></script>
    <script src="sketch.js"></script>
</body>

p5.animS functions have very similar interfaces as p5.js functions do. For example, animS.circle() renders the creation animation of a circle:

function setup() {
    createCanvas(960, 240);
    colorMode(HSB, 360, 100, 100, 1);
}

function draw() {
    background(190, 30, 100);
    noFill();
    stroke(0, 0, 100);
    strokeWeight(5);
    animS.circle('c1', 60, 480, 120, 120, 100);
}

function mouseClicked() {
    animS.reset();
}

The first parameter of animS.circle() is a unique instance ID so that the animation state can be kept across frames. The second parameter is the total frame number that the animation last.

animS.reset() is used to replay the creation animation.

Read more at https://wixette.github.io/p5.animS/.

p5.anims's People

Contributors

wixette avatar

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.