缓慢改变activity android
我尝试从 andengine 的 Activity 更改为 Activity,最后加载速度非常慢。当 andengine 活动加载结束时,如何在图像之间插入带有文本“点击开始”的图像。我使用此功能进行更改。
startActivity(new Intent(ChangeLevelActivity.this, GameActivity.class));
overridePendingTransition(R.anim.zoom_enter, R.anim.zoom_exit);
I try to change from Activity to Activity from andengine and last loaded very slow.How can i insert between image with text "Tap to start" when andengine activity loading ends.I use this function to change.
startActivity(new Intent(ChangeLevelActivity.this, GameActivity.class));
overridePendingTransition(R.anim.zoom_enter, R.anim.zoom_exit);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你不应该切换活动——切换场景。
为游戏中的不同“屏幕”创建不同的场景并在它们之间切换 - 场景之间的切换快速且轻松,比活动快得多。
You should not switch activities - switch scenes.
Create different scenes for different "screens" in your game and switch between them - switching between scenes is fast and easy, much faster than activities.
Jong是对的,你应该切换场景而不是活动。
如果您查看 andengine 源代码,有一些场景类型可能对您有用。看看“org.anddev.andengine.entity.scene.*”,如果您愿意,您可以制作自己的场景,或者您可以扩展 MenuScene,这样您就可以有更多选项。
如果您只想要一个在加载后即可启动游戏的按钮,请查看 andengine 示例源中的 PauseExample。您可以在加载后立即“暂停”游戏,并且可以将文本更改为“点击开始”,这将取消暂停引擎。
Jong is right, you should be switching scenes instead of activities.
If you look at the andengine source, there are some scene-types that may be useful to you. Look around "org.anddev.andengine.entity.scene.*" You could make your own scene if you'd like, or you can extend a MenuScene so you can have more options.
If you just want a button that can start the game once it is loaded, check out the PauseExample in the andengine examples source. You could have the game be "paused" immediately after loading, and you can change the text to "Tap to Start", which will unpause the engine.