如何在屏幕上移动一个图像上的Andr​​oid [英] How to move a image across the screen on Android

查看:109
本文介绍了如何在屏幕上移动一个图像上的Andr​​oid的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在屏幕的Andr​​oid移动图像?

How to move an image across the screen android?

大家好,即时通讯创造MoleMash游戏我的课程,我真的需要帮助!我想尝试在屏幕上移动一个图像(摩尔)在不同的和随机的坐标,以便它可以被用户触摸以获取一个分数。我创建了我所做的图像视图的背景。我有痣,它是另一种形象的看法?或者是一个图像按钮?

Guys, im creating MoleMash game for My Coursework and I really need help!. I want to try to move a image (the mole) across the screen in different and random coordinates so that it can be touched by the user to get a score. I created the background which I made the image view. I have the mole, Is it another image view? or is it a Image button?

我如何推动这一跨越到屏幕的不同部分对用户进行交互?

And how do I move this across to different parts of the screen for the user interact?

我将不胜AP preciate您的帮助!

I would greatly appreciate your help!

推荐答案

有关游戏的发展,你需要学习如何使用帆布和SurfaceView:<一href=\"http://stackoverflow.com/questions/4938822/how-can-i-use-the-animation-framework-inside-the-canvas/4946893#4946893\">How我可以使用画布里面的动画框架?

For games development you need to learn how to use canvas and SurfaceView: How can I use the animation framework inside the canvas?

使用onTouch事件监听器,你会与你的动画图像的位置与触摸位置...

Using onTouch event listener you would compare the touch location with the location of your animated images...

这篇关于如何在屏幕上移动一个图像上的Andr​​oid的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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