LibGDX - 如何让我的菜单屏幕切换到游戏屏幕?
问题描述
当我运行应用程序时,我的菜单屏幕显示,但是当我单击屏幕开始玩游戏时,游戏开始玩,但菜单屏幕仍然覆盖游戏.我知道这一点是因为游戏中有音乐播放.我将来还会添加一个启动画面,但我现在并不担心.我是新来的,所以请尽可能地解释事情.以下是用于实现此目的的 3 个类.
When I run the application my menu screen shows, but when I click the screen to begin playing the game the game begins playing but the menu screen is still their overlaying the game. I know this because the game has music playing. I'm also going to add a splash screen in the future but I'm not concerned about that right now. I'm new at this so please explain things as best as you can. Below are the 3 classes used to make this happen.
这里是主菜单屏幕
这是游戏画面
推荐答案
不确定,但我认为您在 GameScreen
上的 render()
方法没有被调用.您必须实现方法 render(float delta)
使用 delta time 作为参数.
Not sure but I think your render()
method on GameScreen
not called. you must implement method render(float delta)
that use delta time for parameter.
替换
与
这篇关于LibGDX - 如何让我的菜单屏幕切换到游戏屏幕?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!