class SlideText{ private PFont font; private String text; private Point finalPoint; private Point currentPoint; public SlideText(String text, PFont font, Point finalPoint){ this.text = text; this.font = font; this.finalPoint = finalPoint; this.currentPoint = new Point(); this.currentPoint.setTo(finalPoint); } public void draw(){ this.currentPoint = this.currentPoint.interp(.2, this.finalPoint); noStroke(); fill(0); textFont(this.font); text(text, this.currentPoint.x, this.currentPoint.y); //text("next", this.currentPoint.x + width - textWidth("next") - 24, this.currentPoint.y); } public void setFinalPoint(Point p){ this.finalPoint.setTo(p); } public void setText(String text){ this.text = text; } }