Libgdx。屏幕组织 [英] Libgdx. Screen organization

查看:297
本文介绍了Libgdx。屏幕组织的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

美好的一天。

我怎么能组织屏幕这样?

How can I organize screen like this?

我的意思是,屏幕上的分裂2部分:游戏场景和面板。
我使用TiledMap类进行渲染的游戏空间。
我的code:

I mean, that screen splitted on 2 parts: game scene and panel. I'm using TiledMap for rendering game space. My code:

map = new TmxMapLoader().load("maps/first.tmx");
mapRenderer = new OrthogonalTiledMapRenderer(map, 1f / 32f);

cam = new OrthographicCamera(MyWorld.CAMERA_WIDTH, MyWorld.CAMERA_HEIGHT);
mapRenderer.setView(cam);

在这种情况下,游戏空间填满整个屏幕。

In that case game space fills whole screen.

感谢。

推荐答案

您可以使用两个摄像头和包裹,人们渲染的游戏场景和其他面板。或者,如果你使用libgdx 舞台您可以使用两个阶段,游戏的场景阶段之后绘制面板的阶段。

You can use two cameras and overlay them, one renders the game scene and the other the panel. Or if you use the libgdx Stage you can use two stages and draw the panel stage after the game scene stage.

这篇关于Libgdx。屏幕组织的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆