go-p5 / p5

p5 is a simple package that provides primitives resembling the ones exposed by p5js.org
https://go-p5.github.io/
BSD 3-Clause "New" or "Revised" License
150 stars 12 forks source link

p5: implement more of p5js API #6

Open sbinet opened 3 years ago

sbinet commented 3 years ago

we should implement more of the p5js API:

math

koxu1996 commented 3 years ago

What about loading and rendering images, is it planned?

sbinet commented 3 years ago

it wasn't. it's just been added to the TODO list :)

koxu1996 commented 3 years ago

Keyboard events e.g. keyPressed() are missing as well. I was thinking about adding such functionality here: https://github.com/go-p5/p5/blob/cbaf5d8b21ca3ae9f2d75af07728070a0939bf31/proc.go#L240 however you are the master of Golang and Gio, so I hope you could implement it :grin:

sbinet commented 3 years ago

a first stab is over there:

but I am not completely satisfied with the API (nor with some limitations + performances. see: gio-list)

koxu1996 commented 3 years ago

@sbinet Nice! I would like to prepare better PR, just give me few days.

PR attempt: https://github.com/go-p5/p5/pull/53.

LCRERGO commented 1 year ago

Are you planning on implementing the noise(), noiseDetail() and noiseSeed()?

sbinet commented 1 year ago

I've added those to the bucket list.

Perlin noise isn't super complicated and there are a couple of Go packages to implement it:

@LCRERGO, do you want to give it a try ?

LCRERGO commented 1 year ago

I've added those to the bucket list.

Perlin noise isn't super complicated and there are a couple of Go packages to implement it:

@LCRERGO, do you want to give it a try ?

Sure, I'll take a look at it

amirkhaki commented 8 months ago

for mouse and keyboard callback, isn't is possible to simply pass the gio events to the user callbacks? (instead of maintaining a global variable for current state of the mouse) keyPressed(key.Event) mouseChanged(pointer.Event)