I have draw a circle using paint
and canvas
in android
.
I want to move the circle in some direction, are there any API methods that can be used ? Or do I have to use a loop and changing the position each time?
I have draw a circle using paint
and canvas
in android
.
I want to move the circle in some direction, are there any API methods that can be used ? Or do I have to use a loop and changing the position each time?
It's hard to answer, because it depends on what would be the real application.So maybe it would suit you best to build your "picture" from smaller components like ImageView and then use Animation to move ImageView around. If not, you may need to re paint your canvas.
Hi you can refer the code below, In onTouchEvent, you can handle directions and move the object.
// Tutorial2D.java main activity
// Square.java