Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 libgdx,我正在加载我的所有纹理,如下所示,
Texture objTexture=new Texture(Gdx.files.internal("imagename"));
这段代码在我的 ApplicationListener 中。但是,我想在游戏开始时加载所有图像。我不想将它们加载到 ApplicationListener 中。我尝试在 OpenGL 范围之外访问纹理对象但失败了。有人可以建议我吗?
我认为您可以尽快加载这些纹理(它涉及将它们上传到 VRAM,所以我猜必须初始化 Graphics 模块并完成所有 GL 工作)create在ApplicationListener.
create
ApplicationListener
此外,您可以考虑使用新AssetManager的来管理您的资源。或者编写一个更简单的资产管理器。
AssetManager