easing question
in
Programming Questions
•
7 months ago
hi,
how to put rect to start from the center?
and how to set left and right bounds?
best, k
how to put rect to start from the center?
and how to set left and right bounds?
best, k
- float offset = 0;
float easing = 0.05;
void setup(){
size(400,400);
}
void draw(){
background(255);
float dx = (mouseX-20) - offset;
offset += dx * easing;
fill(0);
rect(offset,height/2,20,20);
}
1