0.9.0 • Published 1 year ago

p8g.js v0.9.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Precessing

Beginner friendlyLanguage-agnosticCross-platform
p8g has been developed for individuals interested in getting into creative programming no matter the experience.p8g is available for C, C++, Java, JavaScript and TypeScript allowing further language bindings to be developed.p8g applications can be developed on and built for all major operating systems including Windows, Linux and macOS as well as the web.

Install

npm install p8g.js

npm install vite --save-dev

npm install vite-plugin-top-level-await --save-dev

Hello rectangle!

.
├── hello-rectangle.js
├── index.html
└── vite.config.js

hello-rectangle.js

import p8g, {
  background,
  createCanvas,
  rect,
} from 'p8g.js';

p8g.draw = () => {
  background(220);
  rect(50, 50, 100, 100);
};

createCanvas(320, 320);

index.html

<!DOCTYPE html>
<html>
  <head>
    <title>Hello rectangle!</title>
  </head>
  <body>
    <script type="module" src="hello-rectangle.js"></script>
  </body>
</html>

vite.config.js

import { defineConfig } from 'vite';
import topLevelAwait from 'vite-plugin-top-level-await';

export default defineConfig({
  plugins: [topLevelAwait()],
});

Run

npx vite

Links

0.9.0

1 year ago

0.8.3

1 year ago

0.8.1

2 years ago

0.8.0

2 years ago

0.8.2

2 years ago

0.7.2

2 years ago

0.7.1

2 years ago

0.7.0

2 years ago