android canvas draw circles and get touch events

2019-02-14 23:45发布

i have been trying to make such a demo where i need to draw many(hundreds of) circle shapes on canvas(or any other way if possible) ,

after drawing the canvas i need to zoom and move it..

and also want to capture the click(touch) event of each shape separately ..

so i know i can get canvas touch event and get x and y positions and check which which circle is touched but i have to draw many circles and as well after zooming and moving the circle's x and y pos is changes so plz help me..

Give me any suggestion how to do this..the way to go.. or if any ANDROID MASTER have done some thing like this..plz plz give me code sample..

thank you all, good day..

1条回答
劫难
2楼-- · 2019-02-15 00:42

according your requirement you have 2 use one of the android game framework you can find so many game engine check this thread or you can use andengine one of the best 2D game engine in that you can find many example code.

for your requirement just follow the PinchZoomExample from here

any further help comment the question i love to help this prob.

查看更多
登录 后发表回答