Skip to content

A library for making 2d shapes that are easy to move around within p5.js

Notifications You must be signed in to change notification settings

brennnnan/draggableShapes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

draggable Shapes

This is a library for making 2d shapes that are easy to move around within p5.js. It uses the 2dCollide library as well.

Setup

  • Download the p5.draggableShape.js and p5.2dcollide.js files and add them to you sketch's libraries
  • Link the libraries in the html in your p5 project folder.
  • You're good to go.

You can find out more about installing p5 libraries here.

Usage

var circle, square, triangle;

function setup() {
  circle = new draggableCircle(xPos,yPos,width,strokeColor,fillColor);
  square = new draggableRect(xPos,yPos,width,height,strokeColor,fillColor);
  triangle = new draggableTriangle(xPos,yPos,width,strokeColor,fillColor);
}

function draw() {
  background(255);
  circle.display();
  square.display();
  triangle.display();
}

About

A library for making 2d shapes that are easy to move around within p5.js

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published