Skip to content

Parameters

gaw1ik edited this page Oct 7, 2021 · 3 revisions

Parameter controls (like sliders and numeric inputs) are created automatically in the Controls panel when they are defined in the Parameters editor. Parameters can then be used as variables anywhere in the drawFunction (using the same exact name you defined in the Parameters editor) and they take on the value of the control allowing you to easily manipulate your algorithms! Take note of the syntax used for the parameters in the example. Be careful and exact with the syntax. Also notice that you can create headers to help organize your control panel.

Parameter Classes

text
section1:  {class:"text", type:"H2", value:"Geometry"}
section1a: {class:"text", type:"H3", value:"Size & Shape"}

type can be "H1", "H2", "H3", "H4", "H5", or "P" (paragraph).


slider
width: {class:"slider", default:0.5, min:0.1, max:1.0, step:0.01}

number
seed:{class:"number", default:1, min:1, max:1000, step:1}

Convenience Classes:

slider-hue
hue: {class:"slider-hue"}

A slider that ranges from 0-359 in steps of 1.


slider-sat
sat: {class:"slider-sat"}

A slider that ranges from 0-100 in steps of 1.


slider-lit
lit: {class:"slider-lit"}

A slider that ranges from 0-100 in steps of 1.


slider-alpha
alpha: {class:"slider-alpha"}

A slider that ranges from 0-255 in steps of 1.


switch
fillMode:{class:"switch"}

A short slider input that ranges from 0-1 in steps of 1. Convenient for binary values like fillMode or on-off type values.


seed
seed:{class:"seed"}

A numeric input that ranges from 1-9999 in steps of 1. Useful for parameterizing seed values for random number functions.


Clone this wiki locally