Question
Scrolling graphic
Hello,
I have the following code from an old conversation (Animate HTML5)
var startPoint = {x:500, y:250};
var endPoint = {x:500, y:250};
var shapePt = new createjs.Shape();
this.addChild(shapePt);
createjs.Ticker.addEventListener("tick", tick);
function tick() {
endPoint.x -= 1.8;
shapePt.graphics.clear().
setStrokeStyle(2).
beginStroke("green").
moveTo(startPoint.x, startPoint.y).
lineTo(endPoint.x, endPoint.y);I want the line to be a curve that depends on the coordinates of a point in order to draw a scrolling graph. I tried adding :
createjs.Tween.get(startPoint), {loop: -1})
.to({x:500, y: startPoint.y + 100},1200)
.to({x:500, y: startPoint.y})But I can't get it to work. Could someone please help me ?
Translated with www.DeepL.com/Translator (free version)
