简体   繁体   English

Libgdx Android游戏分割画面

[英]Libgdx Android game dividing screen

Hi I am having trouble working with libgdx making a game. 嗨,我在使用libgdx制作游戏时遇到了麻烦。 In the image provided you can see there are sections: a minimap, character stats, character actions, and a big map. 在所提供的图像中,您可以看到以下部分:小地图,角色统计信息,角色动作和大地图。 I am wondering how do I divide the screen to have each of these actions. 我想知道如何划分屏幕以执行所有这些操作。 So far I have the big map loaded. 到目前为止,我已经加载了大地图。 Would the whole screen be a stage? 整个屏幕会成为舞台吗? And each section be actors? 每个部分都是演员? I am kind of confused on how libgdx works compared to android studio and xml files. 与Android Studio和xml文件相比,我对libgdx的工作方式感到困惑。 Thanks in advance 提前致谢

gamescreen

bettergamescreen

Maybe it's too late, but I'll write it for the other users, reading this post. 也许为时已晚,但是我会为其他用户编写,阅读这篇文章。

On top of your game you render your UI. 在游戏之上,您可以渲染用户界面。 One viewport and stage for UI and a viewport and camera+batch for the game. UI的一个视口和舞台,游戏的视口和相机+批处理。 Next you have a third camera, and you render with it to a FBO (framebuffer) , and simply display it in your UI. 接下来,您将拥有第三个相机,并将其渲染到FBO(帧缓冲区),然后将其显示在用户界面中。 Try searching for FBO with libgdx in the net, you'll find some examples. 尝试在网上使用libgdx搜索FBO,您会找到一些示例。 If not, just ask , I'll post an example. 如果不是,请询问,我将举一个例子。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM