最好的方式来加载在libgdx大背景 [英] Best way to load big background in libgdx

查看:485
本文介绍了最好的方式来加载在libgdx大背景的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用libgdx开发游戏。现在,我想有一个背景都在我的地图(地图大小不固定但我会稍后决定)。我的地图是基于瓦片,但我不使用TiledMaps。所以,我创建并装入自己的code /编辑地图。

I am developing a game using libgdx. Now i'd like to have a Background all over my map (Map size is not fixed yet i'll decide later). My map is tile based but i don't use TiledMaps. So i create and load the map with own code/editor.

我现在的问题:我应该如何实现后台的事情吗?

My question now: How should i implement the background thing?

我想到了不同的方式:


  • 加载一个巨大的图片,其中涵盖了所有的地图。这是不是真的好,因为我渲染的东西,这是不是在我的视区(80瓦X,50瓦Y)

Deviding图像在4个或更多的图像和加载一个在口中。问题:在某些时候,所有图像可能部分是视口,以便所有的图像发送到GPU权

Deviding the Image in 4 or more Images and loading the one in the viewport. The Problem: At some point maybe part of all Images is in viewport so all Images are sent to GPU right?

有1图像,覆盖视区(80,50)并遵循相机。最佳性能我想,但它看起来愚蠢的......

Having 1 Image which cover the viewport (80,50) and follows the camera. Best performance i think, but it will look stupid...

或者每瓦都有一个自己的形象和对象都在他们之上绘制。请注意,我只呈现瓷砖视窗内。但在Gamestart那就需要加载有关在每一个级别的瓷砖信息。

Or every tile has an own Image and the Objects are drawn above them. Notice that i only render Tiles inside the viewport. But on Gamestart it would need to load Information about every tile in the level.

有关信息:我的比赛是自上而下和背景显示地板所以没有详细的丘陵等需要,只是也许一些简单的沙漠外观和类似的东西。是否有其他更好的方法?

For Information: My Game is Topdown and the Background Shows the floor so no detailed hills etc are needed, just maybe some simple desert sand look and things like that. Is there another even better way?

什么是性能和光学的最佳方式?

What would be the best way for performance and optic?

推荐答案

如果你的游戏的瓷砖基于。它将使更多的意义有藏汉平铺的背景。只需使用另一个它。如果你的编辑器/加载器不支持多个图层,那么我会建议您切换到另一个,或添加这些功能(如果可能)。

If your game is Tile Based. It would make much more sense to have the background tiled aswell. Just use another layer for it. If your editor/loader does not support multiple layers, then I would recommend you to switch to another one, or add those features to it (if possible).

背景显示地板所以没有详细的丘陵等需要,只是也许一些简单的沙漠外观和类似的东西。

The Background Shows the floor so no detailed hills etc are needed, just maybe some simple desert sand look and things like that.

这是有点像沙漠很容易的重用砖,因为他们所有的瓦片都非常相似(砂)。

It is very easy to reuse tiles in something like a desert, because all their tiles are very similar (sand).

这篇关于最好的方式来加载在libgdx大背景的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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