android canvas draw circles and get touch events

非 Y 不嫁゛ 提交于 2019-11-30 18:06:01

问题


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:


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.



来源:https://stackoverflow.com/questions/6662920/android-canvas-draw-circles-and-get-touch-events

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!