-
Notifications
You must be signed in to change notification settings - Fork 209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
没有可以进行荧幕缩放的函数 #13
Comments
你是为了做不同尺寸手机的适配吧?建议代码里面使用相对坐标。比如点击屏幕中心点,你可以写成 |
不是手机适配耶,是真的需要缩放荧幕,里面的场景物件会跟着放大缩小,才可以用模板找图,所以需要先把荧幕画面缩到最小,而有的时候为了精确一点匹配需要放大。虽然作者有提出使用阈值控制的方法,但是我的场景里有许多相似的物件。我的游戏是“部落冲突”。 |
哈哈。实现了 |
额,你添加的好像是图片的缩放对吗,我需要的是像是我们使用手机时二指缩放荧幕那种。我附上我尝试的代码可能比较好理解我需要什么。
|
额。。你想要的是多点触控,你如果要用Instrumentation实现的话可以看看这篇文章 |
这是我看了作者你给的网站之后修改的函数,但是会直接停止robothelper,想问一下是我哪里写错了吗 public static void rescale(boolean toSmaller,int distance,int duration_ms) {
|
尝试了好久终于成功了。 import android.app.Activity; public class Robot extends Activity {
|
我刚用github不久,还不太会使用,可能要麻烦作者你自己添加一下了。 首先要multitouch好像需要override onTouchEvent,然后在选择MotionEvent.obtain的时候选择可以做multitouch的那个函数, |
感谢分享!代码稍微做了点修改,已经合到主分支了 |
目前我写的脚本有需要做到荧幕的缩放,但是使用现有的函数比如down,up,moveTo来重写一个都没办法做到。因为对android及java其实不是很熟悉,所以希望作者可以写一下实现的方法,谢谢。
The text was updated successfully, but these errors were encountered: