简体   繁体   English

Libgdx | 如何创建小地图?

[英]Libgdx | How to create minimap?

I am making a top-down maze game in libgdx, and I use an extendViewport to render the game camera. 我在libgdx中制作一个自上而下的迷宫游戏,我使用extendViewport来渲染游戏相机。 I am a bit confused on how I would go about creating a minimap. 关于如何创建小地图,我有点困惑。 Should I create an extra viewport and camera for the minimap? 我应该为小地图创建一个额外的视口和相机吗? I am still new to the whole viewport/camera thing. 我还是整个视口/相机的新手。 Thanks! 谢谢!

Wyatt, the minimap should certainly not be just a smaller version of your entire game viewport. Wyatt,迷你地图当然不应该只是整个游戏视口的较小版本。 The reason is it has different functionality and look compared to the game viewport. 原因是它与游戏视口相比具有不同的功能和外观。 Instead, the minimap should be an Actor on the Stage, which takes in the layout of your map to draw itself and the x and y percentage of your camera's position and size relative to the maze to indicate on the minimap what the player currently sees. 相反,迷你地图应该是舞台上的一个角色,它会在地图的布局中绘制自己以及相机相对于迷宫的位置和大小的x和y百分比,以在小地图上指示玩家当前看到的内容。 If it's at all possible, I suggest you stick with 1 camera and 1 viewport for your entire project unless you are intimately familiar with libgdx. 如果可能的话,我建议您坚持使用1个摄像头和1个视口进行整个项目,除非您非常熟悉libgdx。 You'll save yourself a ton of time and frustration. 你会为自己节省大量的时间和挫折感。 Good luck 祝好运

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

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