Making an interactive Form Inputs on P5.js

Trust you are doing great!

I am an avid user of this javascript library of P5.js

Just to know if, how to create an interactive form inputs to generate objects (Circle, Rectangle, Lines) on a canvas, via the user’s form inputs.

I wanted an interface to prevent a non-technical user from writing codes, but input values on HTML Form, like shape: rectangle, or input color: red and automatically generate the object on a canvas.

I will appreciate your timely response.

Thank you.

Regards,
ADEBAYO, ABIODUN F.

1 Like


@GoToLoop Can you please provide explanations when you post links?

@Abbeysoft You might want to look into the P5.dom library, especially the createInput() function.

Also note that since P5.js is just JavaScript, you can get the value of an HTML input element using normal JavaScript as well. Googling something like “javascript get value of input element” will return a ton of results.

3 Likes