-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
writing function implementation #1
Comments
Some of the points that I want to note
Let me know your thoughts @two-ticks @nick We have to decide how textConfig and fadeConfig looks like. Since its typescript we can even define interfaces for the same |
Event triggered methodI tried something like this example. Mouse press plays the animation. let click = true;
let a, b;
function setup() {
createCanvas(400, 400);
}
function draw() {
background(220);
a = new writeText("Circle : x² + y² = 4²", width / 4, height / 3);
b = new writeText("Circle : (x-1)² + y² = 4²", width / 5, height / 2);
noLoop();
}
function mousePressed() {
if (click) {
a.play(); //default delay duration = 180
} else {
b.play(600); //delay duration = 600
}
click = !click;
} Time delay methodanother way of doing it without event triggers is example function setup() {
createCanvas(400, 400);
}
function draw() {
background(220);
let a = new writeText("Circle : x² + y² = 4²", width / 4, height / 3);
let b = new writeText("Circle : (x-1)² + y² = 4²", width / 5, height / 2);
a.play(); //default delay duration = 180
b.play(3600); //delay duration = 3600
noLoop();
} What are your thoughts on this ? @JithinKS97 @nickmcintyre |
If we have to always provide the delay input in the animation, we should always understand how much time the previous animations play right? Can you see if we can make use of promises to do this in a way so that this delay time parameter is not specified?
See this We need to have more discussion about these interface. I'm not sure how much async await syntaxes will be familiar to the common users of the library. |
I will try to use promises.
I am also learning about async and await so I think my reaction would be similar to other common users of library. |
I don’t recall coming across much use of async and await in p5.js libraries. The programming model may be a hurdle for beginners or people coming from MATLAB, etc. |
Okay, then we have to think of some other ways to do this. But I think providing delay time for all the functions is a very tedious thing to do. |
Which syntax we should use to call the
animation
functions?We can avoid creating many functions for animations by implementing text animations in some what similar manner to manim
In the proposal we have following (web-editor example writing)
manim has following syntax
The text was updated successfully, but these errors were encountered: