Gaweph / p5-typescript-starter

Base starter project using p5js and typescript
MIT License
344 stars 173 forks source link

createSlider seems to be undefined #6

Closed sthaha closed 4 years ago

sthaha commented 4 years ago

createSlider throws an Uncaught ReferenceError: createSlider is not defined

e.g.

function setup() {
  createCanvas(windowWidth, windowHeight)
}

function draw() {
  rect(width/2 - 40 , height/2 - 30, 80, 60)
}

let x = createSlider(0, 1, 10)
sthaha commented 4 years ago

https://github.com/Gaweph/p5-typescript-starter/issues/1#issuecomment-456405899 addresses this.

Gaweph commented 4 years ago

Sorry for delay in reply. Glad you worked it out. Since this has been mentioned more than once it might be worth adding the dom library to the default example.

sthaha commented 4 years ago

yes, I feel having it as default makes a lot of sense especially because tsc complies fine and you see the error only when you run it. Alternatively, it may help if this is pointed out in the README.

Thanks @Gaweph for the quick start, it helped a lot!

Gaweph commented 4 years ago

@sthaha Dom and Sound libraries are now part of the default demo thanks for your input.