P5Canvas Helper Class
概要
P5Canvasはp5.jsをPyScript(ブラウザ上で動くPython)で使うためのヘルパーライブラリです。
使い方
import P5Canvas
class MyCanvas(P5Canvas):
def setup(self, p5):
self.x = 100
self.y = 100
p5.createCanvas(300, 300)
def draw(self, p5):
p5.background(128)
p5.fill(255, 0, 0)
p5.ellipse(self.x, self.y, 50, 50)
if p5.keyIsDown(p5.LEFT_ARROW):
self.x -= 1
if p5.keyIsDown(p5.RIGHT_ARROW):
self.x += 1
if p5.keyIsDown(p5.UP_ARROW):
self.y -= 1
if p5.keyIsDown(p5.DOWN_ARROW):
self.y += 1
MyCanvas().run()
Release files for P5Canvas 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| p5canvas-1.0.0.tar.gz | 2.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| P5Canvas-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 4.9 kB
Release files / p5canvas-1.0.0.tar.gz
| Download URL | p5canvas-1.0.0.tar.gz |
|---|---|
| Size | 2.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
64e072983a136e2c4dfea2538e0fc1471162b282fb4446b553b2fa562e72588d
|
|
BLAKE2b-256 checksum How to use checksums |
7da615c4d7a7d9344898c04b638a054d844c6e1c19bd7dfa15d38b5b791db2cf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.12.3
|
Release files / P5Canvas-1.0.0-py3-none-any.whl
| Download URL | P5Canvas-1.0.0-py3-none-any.whl |
|---|---|
| Size | 2.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2416d5826b1932826b2cb434d7f72d70a2fea52cf6d987069c0d9ccb4f533759
|
|
BLAKE2b-256 checksum How to use checksums |
3e2479fc9088e46d13333622292d8b8f8a1799a4d09d1516604665a7829f0aed
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.12.3
|