# P5Canvas Helper Class
## 概要
P5Canvasは[p5.js](https://p5js.org/)をPyScript(ブラウザ上で動くPython)で使うためのヘルパーライブラリです。
## 使い方
```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()
```
Raw data
{
"_id": null,
"home_page": null,
"name": "P5Canvas",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "PyScript, p5.js, Canvas, Processing",
"author": "Uniras",
"author_email": "tkappeng@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/7d/a6/15c4d7a7d9344898c04b638a054d844c6e1c19bd7dfa15d38b5b791db2cf/p5canvas-1.0.0.tar.gz",
"platform": null,
"description": "# P5Canvas Helper Class\r\n\r\n## \u6982\u8981\r\n\r\nP5Canvas\u306f[p5.js](https://p5js.org/)\u3092PyScript(\u30d6\u30e9\u30a6\u30b6\u4e0a\u3067\u52d5\u304fPython)\u3067\u4f7f\u3046\u305f\u3081\u306e\u30d8\u30eb\u30d1\u30fc\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u3059\u3002\r\n\r\n## \u4f7f\u3044\u65b9\r\n\r\n```python\r\nimport P5Canvas\r\n\r\nclass MyCanvas(P5Canvas):\r\n def setup(self, p5):\r\n self.x = 100\r\n self.y = 100\r\n p5.createCanvas(300, 300)\r\n\r\n def draw(self, p5):\r\n p5.background(128)\r\n p5.fill(255, 0, 0)\r\n p5.ellipse(self.x, self.y, 50, 50)\r\n\r\n if p5.keyIsDown(p5.LEFT_ARROW):\r\n self.x -= 1\r\n if p5.keyIsDown(p5.RIGHT_ARROW):\r\n self.x += 1\r\n if p5.keyIsDown(p5.UP_ARROW):\r\n self.y -= 1\r\n if p5.keyIsDown(p5.DOWN_ARROW):\r\n self.y += 1\r\n\r\nMyCanvas().run()\r\n```\r\n",
"bugtrack_url": null,
"license": "MIT License",
"summary": "Helper Class for Using p5.js with PyScript.",
"version": "1.0.0",
"project_urls": {
"Homepage": "https://github.com/uniras/P5Canvas",
"Repository": "https://github.com/uniras/P5Canvas"
},
"split_keywords": [
"pyscript",
" p5.js",
" canvas",
" processing"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "3e2479fc9088e46d13333622292d8b8f8a1799a4d09d1516604665a7829f0aed",
"md5": "24275ccb0628a7808c495c39a848f1e3",
"sha256": "2416d5826b1932826b2cb434d7f72d70a2fea52cf6d987069c0d9ccb4f533759"
},
"downloads": -1,
"filename": "P5Canvas-1.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "24275ccb0628a7808c495c39a848f1e3",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 2474,
"upload_time": "2024-06-15T07:51:55",
"upload_time_iso_8601": "2024-06-15T07:51:55.504703Z",
"url": "https://files.pythonhosted.org/packages/3e/24/79fc9088e46d13333622292d8b8f8a1799a4d09d1516604665a7829f0aed/P5Canvas-1.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "7da615c4d7a7d9344898c04b638a054d844c6e1c19bd7dfa15d38b5b791db2cf",
"md5": "0e1554aeb02fd5312acbf5bb00bf32f2",
"sha256": "64e072983a136e2c4dfea2538e0fc1471162b282fb4446b553b2fa562e72588d"
},
"downloads": -1,
"filename": "p5canvas-1.0.0.tar.gz",
"has_sig": false,
"md5_digest": "0e1554aeb02fd5312acbf5bb00bf32f2",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 2397,
"upload_time": "2024-06-15T07:51:57",
"upload_time_iso_8601": "2024-06-15T07:51:57.396597Z",
"url": "https://files.pythonhosted.org/packages/7d/a6/15c4d7a7d9344898c04b638a054d844c6e1c19bd7dfa15d38b5b791db2cf/p5canvas-1.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-06-15 07:51:57",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "uniras",
"github_project": "P5Canvas",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "p5canvas"
}