hydra-p5

0.1.2 • Public • Published

hydra-p5

A simpler P5 intergration for Hydra

Usage

await loadScript("https://unpkg.com/hydra-p5")

p5src(s0)
  .setup((p) => {
    // this runs only once, but re-executes
    // when evaluating the whole block...
  })
  .draw((p) => {
    // this runs on every frame
    p.clear()
    p.rect(p.mouseX, p.mouseY, 300, 300)
  })
  // now you can keep using hydra like a normal source...
  .modulate(noise())
  .out()

There is an experimental drawP and setupP that allows you to use P5 in "global" mode inside their callback functions:

p5src(s0)
  .drawP(_ => {
    clear()
    rect(mouseX, mouseY, 300, 300)
  })
  .out()

Contributing

Bug reports and pull requests are welcome on GitHub at the issues page. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

This project is licensed under GPL 3+. Refer to LICENSE.txt

Readme

Keywords

none

Package Sidebar

Install

npm i hydra-p5

Weekly Downloads

2

Version

0.1.2

License

GPL-3.0-or-later

Unpacked Size

41 kB

Total Files

9

Last publish

Collaborators

  • munshkr