0
我想在兩點之間畫帆布線動畫。該線正在工作完美,但我希望動畫,而繪製線。下面的代碼畫線:帆布畫線動畫
// draw route
for (int i = 0; i < routeList.size() - 1; i++) {
float[] goal1 = {nodeList.get(routeList.get(i)).x,
nodeList.get(routeList.get(i)).y};
float[] goal2 = {nodeList.get(routeList.get(i + 1)).x,
nodeList.get(routeList.get(i + 1)).y};
currentMatrix.mapPoints(goal1);
currentMatrix.mapPoints(goal2);
paint.setStrokeWidth(routeWidth);
canvas.drawLine(goal1[0], goal1[1], goal2[0], goal2[1], paint);
}
可以請你在Java或Android解釋? –