android game pause screen , dialog or activity dialog?

為{幸葍}努か 提交于 2019-12-11 08:48:22

问题


I am a little confused about the best way to show pause screen on my android game. will it be better to be a pauseMenuActivity or is it enough with just pauseDialog? this pause dialog will just show score, money, back button, option button , and quit button. if it is better to show dialog, I don't know how to show those buttons and background image.. anyone can help me? thank you


回答1:


I would recommend going for a Dialog (or some other custom overlay). From my experience, inter-Activities transitions aren't always very quick and they can feel kind of sluggish in the context of a game. In my opinion, when I am on a pause screen and want to start playing again, it should be instantaneous.

Plus, an Activity is kind of overkill if you just want to show 4 buttons.

To create a custom dialog containing a custom layout, have a look at the following tutorial and post again if you have specific questions/problems : http://developer.android.com/guide/topics/ui/dialogs.html#CustomDialog




回答2:


An Activity in general is better than a dialog, because u can take care of all things like orientation, theme etc. and it provides more flexibility. Though in simple cases u can use a dialog.



来源:https://stackoverflow.com/questions/5290333/android-game-pause-screen-dialog-or-activity-dialog

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