Putting it all together
Cool! Now you have a model to handle your slides. All you need to do now is to bring it into your sketch
let myModel; //make a variable to store your model in
let sketch1 = {};
let sketch2 = {};
let sketch3 = {};
function setup() {
createCanvas(windowWidth, windowHeight)
defineSketches() //
let titleOptions = {
"header": "HELLO, WORLD!",
"subHeader": "subtitle",
}
let titleSlide = new StaticSlide(titleOptions)
let endOptions = {
"header": "Thanks! (◡‿◡✿)"
}
let endSlide = new StaticSlide(endOptions)
myModel = new Model([titleSlide,
sketch1,
sketch2,
sketch3,
endSlide])
for (slide of myModel.slides) {
slide.setup()
}
}
Drawing
function draw() {
myModel.draw()
}
Input
function keyPressed(){
myModel.getInput(keyCode)
}