SurfaceView 上获取用户文本输入的对话框
我想知道如何在我正在编程的游戏结束时获得用户输入。基本上,当你失去三个生命时,我想停止游戏(停止所有线程),然后显示某种对话框,允许用户给出他们的名字,以便可以以高分保存。然而,这一切都是在 SurfaceView 中完成的。有人对这样的事情有什么好的参考吗?谢谢你!!
I am wondering how I can get user input at the end of a game I am programming. Basically, when you lose three lives, I want to stop the game (stop all threads) and then display some sort of dialog box that allows the user to give their name so it can be saved with the high score. This is all being done in a SurfaceView, however. Does anybody have any good references to something like this? Thank you!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为你可以简单地使用 FrameLayout 并将你的 SurfaceView 与其他布局,其中包含您的文本输入表单及其任何标签...
FrameLayout 能够将多个视图堆叠在一起,以便我猜这将满足您的需要。
I think you can simply use FrameLayout and put your SurfaceView there along with other layout which has your text entry forms plus any labels for it...
FrameLayout is capable of stacking several views on top of eachother so that would do what you need I guess.