简体   繁体   English

Java libGDX与相机断开连接

[英]Java libGDX disconnection from the camera

In the game I got the text, hero and opponent. 在游戏中,我得到了文字,英雄和对手。 The camera OrthographicCamera is focused on a hero so text moves around the screen. 相机OrthographicCamera专注于英雄,因此文本在屏幕上移动。 Can somehow be disconnected text from the camera? 可以以某种方式断开相机中的文本连接吗? To be in one place. 在一个地方。

You can use Two Cameras to achieve this easily. 您可以使用两台相机轻松实现此目的。 Keep one moving with the player, and keep one fixed to the screen. 保持一只与播放器一起移动,并保持一只固定在屏幕上。

Use the second one to draw only text. 使用第二个仅绘制文本。


Reference : Multiple cameras in libgdx ( probably similar in other frameworks ) 参考: libgdx中的多个摄像机(在其他框架中可能类似)

Hope this helps. 希望这可以帮助。

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

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