diff --git a/Changelog.txt b/Changelog.txt new file mode 100644 index 00000000..64864fe5 --- /dev/null +++ b/Changelog.txt @@ -0,0 +1,27 @@ +0.0.5 +----- +- Adds all p5's missing global variables + +0.0.4.1 +------- +- Supports event functions such as `keyPressed` + +0.0.4 +----- +- Supports p5.js pop function +- Adds `monitor` command to the CLI +- Allows to run `pyp5js` commands specifying a directory +- First try on organizing the docs + +0.0.3 +----- +- Add WEBGL variables + +0.0.2 +----- +- Supports more of P5's variable + + +0.0.1 +----- +- First release diff --git a/dev-requirements.txt b/dev-requirements.txt new file mode 100644 index 00000000..2b85dcdd --- /dev/null +++ b/dev-requirements.txt @@ -0,0 +1,3 @@ +-r requirements.txt +pytest==4.5.0 +tox==3.10.0 diff --git a/docs/examples/index.md b/docs/examples/index.md index 9a51618e..05e23d45 100644 --- a/docs/examples/index.md +++ b/docs/examples/index.md @@ -1,8 +1,15 @@ ### Examples list -- [Angles and mouse coordinates](sketch_001/index.html) -- [Move Eye](sketch_002/index.html), [@villares](https://github.com/villares) implementation of Simon Greenwold's code -- [3D](sketch_003/index.html) -- [Boids](sketch_004/index.html) from [@esperanc](https://github.com/esperanc) [BrythonIDE examples](https://github.com/esperanc/brythonide/blob/master/demoSketches/boids.py) -- [Globals variables (HSB and CENTER)](sketch_005/index.html) -- [Registering event functions such as keyPressed](sketch_006/index.html) +- Angles and mouse coordinates: [see code](https://github.com/berinhard/pyp5js/tree/develop/docs/examples/sketch_001) | [run example](sketch_001/index.html) + +- Move Eye, an example by Simon Greenwold, ported by [@villares](https://github.com/villares): [see code](https://github.com/berinhard/pyp5js/tree/develop/docs/examples/sketch_002) | [run example](sketch_002/index.html) + +- Rotating 3D box: [see code](https://github.com/berinhard/pyp5js/tree/develop/docs/examples/sketch_003) | [run example](sketch_003/index.html) + +- Boids, from [@esperanc](https://github.com/esperanc) [BrythonIDE examples](https://github.com/esperanc/brythonide/blob/master/demoSketches/boids.py): [see code](https://github.com/berinhard/pyp5js/tree/develop/docs/examples/sketch_004) | [run example](sketch_004/index.html) + +- Globals variables (HSB and CENTER): [see code](https://github.com/berinhard/pyp5js/tree/develop/docs/examples/sketch_005) | [run example](sketch_005/index.html) + +- Registering event functions such as keyPressed: [see code](https://github.com/berinhard/pyp5js/tree/develop/docs/examples/sketch_006) | [run example](sketch_006/index.html) + +- p5.Vector static methods: [see code](https://github.com/berinhard/pyp5js/tree/develop/docs/examples/sketch_007) | [run example](sketch_007/index.html) diff --git a/docs/examples/sketch_001/index.html b/docs/examples/sketch_001/index.html index 98164410..46987897 100644 --- a/docs/examples/sketch_001/index.html +++ b/docs/examples/sketch_001/index.html @@ -11,11 +11,80 @@ + + + + + +
-+ Python code here. +
+ + +
+
+from pytop5js import *
+
+t = 0
+
+def setup():
+ createCanvas(600, 600)
+ stroke(250)
+ strokeWeight(3)
+ fill(40, 200, 40)
+
+
+def draw():
+ global t
+ background(10, 10)
+
+ xAngle = map(mouseX, 0, width, -4 * PI, 4 * PI, True)
+ yAngle = map(mouseY, 0, height, -4 * PI, 4 * PI, True)
+ for x in range(0, width, 30):
+ for y in range(0, height, 30):
+
+ angle = xAngle * (x / width) + yAngle * (y / height)
+
+ myX = x + 20 * cos(2 * PI * t + angle)
+ myY = y + 20 * sin(2 * TWO_PI * t + angle)
+
+ ellipse(myX, myY, 10)
+
+ t = t + 0.01
+
+ console.log(frameRate())
+
+
+my_p5 = start_p5(setup, draw, {})
+
+
+