I ave created a path a circle and displayed both of them on screen as follows:
public void onDraw(Canvas canvas){
Path sPath = new Path();
sPath.moveTo(100, 100);
sPath.lineTo(300, 100);
sPath.lineTo(300, 300);
sPath.lineTo(100,300);
sPath.lineTo(100,100);
sPath.close();
Paint ballPaint = new Paint();
ballPaint.setColor(Color.GREEN);
Paint pathPaint = new Paint();
pathPaint.setColor(Color.BLUE);
canvas.drawPath(sPath, ballPaint);
canvas.drawCircle(100,100,20,pathPaint);
}
i would like to have the circle move along the path, how can i do this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…