Android的帆布画圈圈,让触摸事件 [英] android canvas draw circles and get touch events

查看:145
本文介绍了Android的帆布画圈圈,让触摸事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在试图做这样的演示,我需要为很多(数百个)的形状上的画布(或任何如果可能的话其他的方式),

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) ,

画,我需要的变焦和移动画布后 ..

和也想要捕捉的每个形状的点击(触摸)事件单独 ..

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

所以我知道我能得到的帆布触摸事件,并得到x和y位置,并检查其中哪个圈子被感动,但我有缩放和移动圆的x和y pos是更改后得出许多圈子和以及 所以plz帮助我..

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..

给我任何的建议怎么办this..the的路要走.. 或者,如果任何ANDROID法师们做一些事情一样this..pl​​z嘿给我的 code样品 ..

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..

推荐答案

根据您的需求您有2采用了Android游戏框架之一,你可以找到这么多的游戏引擎的检查此线程或者您可以使用andengine一个最好的2D游戏引擎在这你可以找到许多例子code。

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.

为您的要求只要按照PinchZoomExample从这里

for your requirement just follow the PinchZoomExample from here

任何进一步的帮助评论我爱帮这个概率的问题。

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

这篇关于Android的帆布画圈圈,让触摸事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆