Coder Social home page Coder Social logo

processing / p5.js Goto Github PK

View Code? Open in Web Editor NEW
21.0K 498.0 3.2K 97.57 MB

p5.js is a client-side JS platform that empowers artists, designers, students, and anyone to learn to code and express themselves creatively on the web. It is based on the core principles of Processing. http://twitter.com/p5xjs —

Home Page: http://p5js.org/

License: GNU Lesser General Public License v2.1

JavaScript 68.02% HTML 1.71% CSS 0.10% GLSL 0.94% Markdown 29.24%
javascript graphics education learning art design sound html p5js creative-coding

p5.js's Introduction

Since the release of Processing 3.5.4 in January 2020, development has moved to a new repository.

Using a 4.0 release (even an alpha or beta version) is recommended if you find an issue. To avoid confusion, this repo will remain open at least until a 4.0 release is the default download at https://processing.org/download. We chose to move to a new repository so that we could clean out old files accumulated over the last 20 years.

Processing

This is the official source code for the Processing Development Environment (PDE), the “core” and the libraries that are included with the download.

I've found a bug! Let us know here (after first checking if someone has already posted a similar problem). If it's a reference, web site, or examples issue, take that up with folks here. There are also separate locations for Android Mode, or the Video and Sound libraries. The processing.js project is not affiliated with us, but you can find their issue tracker here.

Locked Issues Where possible, I've started locking issues once resolved. This helps reduce the amount of noise from folks adding to an issue that's been closed for years. Because this project has existed for a long time and we have thousands of closed issues, lots of them may sound similar to an issue you're having. But if there's a new problem, it'll be missed if it's lost in a comment added to an already closed issue. I don't like to lock issues because it cuts off conversation, but it's better than legitimate problems being missed. Once an issue has been resolved for 30 days, it will automatically lock.

That processing-bugs fella is suspicious. The issues list has been imported from Google Code, so there are many spurious references amongst them since the numbering changed. Basically, any time you see references to changes made by processing-bugs, it may be somewhat suspect. Over time this will clean itself up as bugs are fixed and new issues are added from within GitHub. Help speed this process along by helping us!

Please help. The instructions for building the source are here. Please help us fix problems, and if you're submitting code, following the style guidelines helps save me a lot of time.

And finally... Someday we'll also fix all these bugs, throw together hundreds of unit tests, and get rich off all this stuff that we're giving away for free. But not today.

So in the meantime, I ask for your patience, participation, and patches.

Ben Fry, 20 January 2019

p5.js's People

Contributors

akshay-99 avatar allcontributors[bot] avatar almchung avatar aloneduckling avatar aryankoundal avatar asukaminato0721 avatar davepagurek avatar dhowe avatar evhan55 avatar garima3110 avatar gr2m avatar inaridarkfox4231 avatar indefinit avatar jesi-rgb avatar kjhollen avatar limzykenneth avatar lmccart avatar montoyamoraga avatar nickmcintyre avatar outofambit avatar perminder-17 avatar qianqianye avatar randomgamingdev avatar sanketsingh24 avatar shiffman avatar spongman avatar stalgiag avatar therewasaguy avatar toolness avatar wong-justin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

p5.js's Issues

Cross-browser testing

Check in Firefox and IE. A later feature would be some kind of method that tests the capabilities of your browser and prints what is and is not supported so if things don't work you know whether it's a bug in the code or a browser limitation. I would love to make the documentation site show on each page whether that function is supported in the browser it's running in or not, but that's more of a +++ feature...

pCurCanvas is undefined

Hello, I started playing around with processing-js, and found a problem when writing my first js sketch. Actually, I just copied the interactive sketch listed in the Getting Started section:

var setup = function() {
  createCanvas(480, 120);
}

var draw = function() {
  if (isMousePressed()) {
    fill(0);
  } else {
    fill(255);
  }
  ellipse(mouseX, mouseY, 80, 80);
}

One thing I noticed first is that the the function createCanvas() doesn't appear to be defined in pjs.js, but size() does, so I replaced createCanvas() with size() in the code above. And then I get the following error:

[16:14:39.892] TypeError: pCurCanvas is undefined @ .../lib/pjs.js:64

I'm using firefox 23.0.1 on OSX 10.6.8.

Thanks a lot for your work!
Andres

key variable is empty

It seems that the key variable is not properly set. if I add the following code to my sketch:

var keyPressed = function() {
println("key: |" + key + "| (" + keyCode + ")");
};

then I get this output in the console:

key: || (0)
key: || (101)
key: || (114)
key: || (101)
key: || (52)
key: || (53)
key: || (53)

Also, the keyCode doesn't appear to be consistent, as it changes when pressing the same key at different times. I'm running Chrome 29.0.1547.57 on OSX 1.6.8.

Libraries

How to include external non-Processing libraries?
Template for building new Processing libraries.

fill out DOM extensions documentation page

https://github.com/lmccart/processing-js/blob/master/extensions.md

createGraphics / PGraphics:
should explain that this replaces size.
also that it is used for on screen drawing as well as offscreen.
also that you can use setContext (name?) to switch between graphics elements or call methods directly as shown in the example. but begin draw and enddraw are not necessary (right?).

http://processing.org/reference/PGraphics.html

and rest of functions on page...

calling textWidth() in setup() gives incorrect results

In the following sketch

var txt = "HELLO";
var txtWidth;

var setup = function() {
  createGraphics(800, 400);

  textSize(20);
  txtWidth = textWidth(txt);  
}

var draw = function() {
  background(255);

  //txtWidth = textWidth(txt);  

  fill(0);  
  text(txt, 30, 30);

  noFill(0);
  stroke(0);
  rect(30, 30, txtWidth, -20);
}

the rectangle doesn't bound the text completely, even tough its width is calculated with textWidth(txt) in setup(). The problem goes away when using the txtWidth = textWidth(txt) line in draw().

Think about / implement typography / text

Typography

  • PFont

Loading & Displaying

  • createFont()
  • loadFont()
  • text()
  • textFont()

Attributes

  • textAlign()
  • textLeading()
  • textSize()
  • textWidth()

Metrics

  • textAscent()
  • textDescent()

invalid assignment left-hand side

I was curious but I could not run your script. On firefox I get an error: "invalid assignment left-hand side". It tries to give a value to this, which is actually a reserved keyword... maybe it had to be _this?

// line 597
this = pCurCanvas.context.createImageData(w,h); 
// line 607
this = context.createImageData(imageData); 

Rhino test

Hey Lauren, are these issues working for you as a way to commit snippets? .. let me know if you feel there is a better way.

I did a tiny Processing test using Rhino (Mozilla's JavaScript engine that is based in Java):
https://gist.github.com/fjenett/5517144

The great thing about Rhino would be that the whole Processing (Java) library ecosystem could be used without much changing.

https://developer.mozilla.org/en-US/docs/Rhino

Ringo is based upon Rhino and brings some additional features like better networking and CommonJS:
http://ringojs.org/

node.js & Java

A rather strange finding and i'm not sure what to think of it ... node.js and Java:

https://github.com/nearinfinity/node-java

I think if node.js is a ingredient then it should work similar to Plask (draw using native libs) instead of binding good ol' Java, no?

Implement curves

Curves

  • bezier()
  • bezierDetail()
  • bezierPoint()
  • bezierTangent()
  • curve()
  • curveDetail()
  • curvePoint()
  • curveTangent()
  • curveTightness()

Vertex

  • beginContour()
  • beginShape()
  • bezierVertex()
  • curveVertex()
  • endContour()
  • endShape()
  • quadraticVertex()
  • vertex()

Implement guideline/spec for canvas startup different cases

  1. no setup() and draw(), no createGraphics()
    doesn't work
  2. no setup() and draw(), createGraphics()
    doesn't work
  3. setup() and draw(), no createGraphics()
    works, default canvas created
  4. setup() and draw(), and createGraphics()
    autodeletes the default canvas, uses createcanvas call to create new one

***Try out examples in learningprocessing /chp1, /chp2, /chp6 once decided.

finish file I/O implementation

Updated after work by @therewasaguy:

XML is the one thing that could really benefit from some more work. Currently, we can load it, but it's hard to do anything with it because there is not yet an XML object like there is in Processing. An XML object could be really useful in tandem with p5.dom. An XML to JSON converter could also be useful even though that wouldn't always translate. I'd like to work on XML in theory, but in reality I'm not sure when I will get a chance, so if anybody is inspired they should go for it (and maybe open up a new ticket?).

More stuff that isn't supported and might be worth adding:

  • loadBytes() / saveBytes() --> actually spent a decent amount of time trying to figure this one out. Maybe this will help.
  • beginRecord() / endRecord() --> save a PDF of the sketch
  • beginRaw() / endRaw() --> could create a vector?

finish implementing PImage

implement:

  • resize()
  • set()
  • mask()
  • filter()
  • copy()
  • blend()
  • save()
  • fix Pimage vs Image
  • tint
  • noTint
  • sort out loadImage vs requestImage (and loadImage (within canvas) not loading from url without a few refreshes)

Color handling

do we have a color type? seems unnecessary.
overloaded color functions (fill, stroke, background) need to be double checked and cleaned up. maybe there should be one helper fxn for processing the overloaded args and then handing back as a standardized obj.

finish implementing mouse

Mouse

  • mouseButton
  • mouseClicked()
  • mouseDragged()
  • mouseMoved()
  • mousePressed()
  • mousePressed
  • isMousePressed()
  • mouseReleased()
  • mouseWheel()
  • mouseX
  • mouseY
  • pmouseX
  • pmouseY

IDEs

Hey Lauren,

not sure how to add things here in an open way, so trying issues for now.

About IDEs: there are some open IDEs around that i think might be interesting for your research here as they embrace JS directly:

Komodo Edit (free, open source version) based on Mozilla XULRunner (like Firefox), comes with SpiderMonkey JS engine included and uses Scintilla as code editor:
http://www.activestate.com/komodo-edit

ICE Coder (pure browser IDE):
http://icecoder.net/

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.