<i id='25pgH'><tr id='25pgH'><dt id='25pgH'><q id='25pgH'><span id='25pgH'><b id='25pgH'><form id='25pgH'><ins id='25pgH'></ins><ul id='25pgH'></ul><sub id='25pgH'></sub></form><legend id='25pgH'></legend><bdo id='25pgH'><pre id='25pgH'><center id='25pgH'></center></pre></bdo></b><th id='25pgH'></th></span></q></dt></tr></i><div id='25pgH'><tfoot id='25pgH'></tfoot><dl id='25pgH'><fieldset id='25pgH'></fieldset></dl></div>

    <small id='25pgH'></small><noframes id='25pgH'>

  • <legend id='25pgH'><style id='25pgH'><dir id='25pgH'><q id='25pgH'></q></dir></style></legend>
  • <tfoot id='25pgH'></tfoot>

        <bdo id='25pgH'></bdo><ul id='25pgH'></ul>

        LibGDX:过滤缩放的 TextureRegion

        时间:2023-05-20
        <i id='BEv4j'><tr id='BEv4j'><dt id='BEv4j'><q id='BEv4j'><span id='BEv4j'><b id='BEv4j'><form id='BEv4j'><ins id='BEv4j'></ins><ul id='BEv4j'></ul><sub id='BEv4j'></sub></form><legend id='BEv4j'></legend><bdo id='BEv4j'><pre id='BEv4j'><center id='BEv4j'></center></pre></bdo></b><th id='BEv4j'></th></span></q></dt></tr></i><div id='BEv4j'><tfoot id='BEv4j'></tfoot><dl id='BEv4j'><fieldset id='BEv4j'></fieldset></dl></div>
          <bdo id='BEv4j'></bdo><ul id='BEv4j'></ul>

                <tfoot id='BEv4j'></tfoot>
                <legend id='BEv4j'><style id='BEv4j'><dir id='BEv4j'><q id='BEv4j'></q></dir></style></legend>
                    <tbody id='BEv4j'></tbody>

                  <small id='BEv4j'></small><noframes id='BEv4j'>

                1. 本文介绍了LibGDX:过滤缩放的 TextureRegion的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  我有几个对象在不同的​​状态下具有不同的纹理,所以我使用了一个用 TexturePacker 制作的 TextureAtlas,并在我需要的地方调整了 TextureRegion 的大小.我必须调整大小,因为我不仅要同时支持 720p 和 1080p,而且我的一些对象是瓷砖或光标,它们会根据棋盘的宽度和高度调整大小,因为这可能会在我的游戏中改变,而棋盘总是占据屏幕的相同百分比.

                  I have several objects with different textures for different states, so I am using a TextureAtlas made with TexturePacker, and resizing the TextureRegion where I need it. I have to resize because not only am I trying to support both 720p and 1080p, but some of my objects are tiles or cursors which resize based on the width and height of the board, as that can change in my game whereas the board will always occupy the same percentage of the screen.

                  使用 Texture,我可以这样做:

                  With a Texture, I can just do this:

                  texture.setFilter(TextureFilter.Linear, TextureFilter.Linear);
                  

                  但是,当我使用 TextureRegion 时,没有设置过滤器的选项.这会导致这些 TextureRegion 的大小调整为锐利、块状和锯齿状.这不是很好的缩放,而且似乎根本没有抗锯齿.

                  However, when I am using a TextureRegion there is no option to set a filter. This results in these TextureRegions resizing as sharp, blocky, and jagged. It isn't nice scaling and it doesn't seem to anti-alias at all.

                  这很令人沮丧,因为我在制作图形方面已经够糟糕了,现在即使我喜欢我制作的东西,它看起来也很糟糕.如何使用 TextureRegion 而不是 Texture 来复制 TextureFilter.Linear 的效果?

                  This is pretty frustrating, because I'm bad enough at making graphics and now even when I like what I've made it looks crappy. What do I do to replicate the effect of TextureFilter.Linear using a TextureRegion instead of a Texture?

                  推荐答案

                  您可以打开 .atlas 文件并将 filter 值更改为 Linear, Linear.或者您可以使用 region.getTexture() 来访问该区域所属的纹理,然后在其上调用 setFilter(...).

                  You can open your .atlas file and change the filter value to Linear, Linear. Or you can use region.getTexture() to get access to the Texture to which the region belongs, then call setFilter(...) on that.

                  这篇关于LibGDX:过滤缩放的 TextureRegion的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:错误:Android Pre Dex:未指定 Android SDK 下一篇:UnsatisfiedLinkError Libgdx 桌面

                  相关文章

                  最新文章

                2. <small id='pMcKh'></small><noframes id='pMcKh'>

                    <tfoot id='pMcKh'></tfoot>
                    • <bdo id='pMcKh'></bdo><ul id='pMcKh'></ul>
                    1. <i id='pMcKh'><tr id='pMcKh'><dt id='pMcKh'><q id='pMcKh'><span id='pMcKh'><b id='pMcKh'><form id='pMcKh'><ins id='pMcKh'></ins><ul id='pMcKh'></ul><sub id='pMcKh'></sub></form><legend id='pMcKh'></legend><bdo id='pMcKh'><pre id='pMcKh'><center id='pMcKh'></center></pre></bdo></b><th id='pMcKh'></th></span></q></dt></tr></i><div id='pMcKh'><tfoot id='pMcKh'></tfoot><dl id='pMcKh'><fieldset id='pMcKh'></fieldset></dl></div>

                      <legend id='pMcKh'><style id='pMcKh'><dir id='pMcKh'><q id='pMcKh'></q></dir></style></legend>