xxxxxxxxxx
50
/*
This is a fork of https://editor.p5js.org/radium.scientist/sketches/ym8mRbuwC
I'm using it to try out p5.teach.js.
*/
let myGreen;
let myMagenta;
let myOrange;
let myBlue;
let myGray;
function setup() {
createCanvas(400, 400);
myGreen = color(229, 255, 234, 125);
myMagenta = color(232, 51, 232);
myOrange = color(255, 157, 91);
myBlue = color(32, 110, 245);
myGray = 75;
background(myGreen);
scene = new Scene();
createControls(); //create play/pause/stop buttons and progress bar
test();
}
function draw() {}
function test() {
/*
let heading = createText("Hello world!");
heading.position(20, 50);
heading.size(45);
heading.style("font-family", "cursive");
heading.fill(color(119, 198, 110));
heading.play("write", 0, 1); //startTime = 0, endTime = 1 sec
*/
let equation = createTeX(
"{\\displaystyle e^{it}=\\kern4pt ?}"
);
equation.position(15, 140);
equation.size(120);
equation.stroke(myMagenta);
equation.fill(myMagenta);
//equation.add();
equation.play("createFill", 0, 6.5); //startTime = 0, endTime = 2.5 sec
}