简体   繁体   English

从多页Atlas加载正确的纹理

[英]Loading correct texture from Atlas with multiple pages

I have a big set of images saved in one atlas, but due to the 2048*2048 size limitation of a single page I had to split my packs in 12 pages. 我在一组地图集中保存了大量图像,但是由于一页的2048 * 2048大小限制,我不得不将包装分成12页。

My problem is that when I use atlas.findRegion(imageName).getTexture() to load the texture, it loads the whole 2048*2048 page and not the single texture inside the page (the image pack contains the correct image though, so I know it's loading the correct file, I just don't understand why it's not cropping the texture around the image I pass as parameter to findRegion). 我的问题是,当我使用atlas.findRegion(imageName).getTexture()加载纹理时,它将加载整个2048 * 2048页面,而不是页面内部的单个纹理(尽管图像包中包含正确的图像,所以我知道它正在加载正确的文件,我只是不明白为什么它没有在作为参数传递给findRegion的图像周围裁剪纹理。

Thanks in advance, hope the question is detailed enough to receive an answer. 在此先感谢您,希望问题足够详尽,能够得到答案。

The problem was actually calling the getTexture() method, I just needed to load the Region. 问题实际上是在调用getTexture()方法,我只需要加载Region。 More info here loading regions of textureatlas in libgdx loads the entire file 这里的更多信息在libgdx中加载textureatlas的区域会加载整个文件

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

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