<bdo id='c6PsJ'></bdo><ul id='c6PsJ'></ul>
  • <small id='c6PsJ'></small><noframes id='c6PsJ'>

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

        <tfoot id='c6PsJ'></tfoot>

      1. <legend id='c6PsJ'><style id='c6PsJ'><dir id='c6PsJ'><q id='c6PsJ'></q></dir></style></legend>
      2. 如何翻转像素图以绘制到 libgdx 中的纹理?

        时间:2023-05-19

              <tbody id='QtbGO'></tbody>

                <bdo id='QtbGO'></bdo><ul id='QtbGO'></ul>

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

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

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

                  本文介绍了如何翻转像素图以绘制到 libgdx 中的纹理?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  所以我要做的是通过将像素图绘制到纹理来为我的游戏生成背景图像.到目前为止,我可以做到这一点,但现在我需要将在 X 或 Y 轴上翻转的像素图绘制到纹理上.但是我找不到任何事情要做.pixmap 类不提供该功能.然后我想我可以将翻转的纹理区域绘制到纹理上,但到目前为止我还没有找到如何做到这一点.所以我想知道我该如何做这样的事情,是否可以使用其他 java 库翻转 png 图像,然后从翻转的图像创建像素图?

                  So what I'm trying to do is to generate a background image for my game by drawing pixmaps to a texture. So far I can do that, but now I need to draw the pixmaps flipped in the X or Y axis to the texture. However I can't find anything to do so. The pixmap class does not provide that functionality. Then I thought I could draw a flipped texture region to a texture, but so far I haven't found how to do so. So I was wondering how can I do such a thing, would it be possible to flip a png image with other java libraries and then create a pixmap from that flipped image?

                  推荐答案

                  除了迭代像素,我也没有看到其他选项:

                  I also don't see other option except to iterate the pixels:

                  public Pixmap flipPixmap(Pixmap src) {
                      final int width = src.getWidth();
                      final int height = src.getHeight();
                      Pixmap flipped = new Pixmap(width, height, src.getFormat());
                  
                      for (int x = 0; x < width; x++) {
                          for (int y = 0; y < height; y++) {
                              flipped.drawPixel(x, y, src.getPixel(width - x - 1, y));
                          }
                      }
                      return flipped;
                  }
                  

                  这篇关于如何翻转像素图以绘制到 libgdx 中的纹理?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:将九个补丁图像加载为 Libgdx Scene2d 按钮背景看起 下一篇:当我在 Android 上运行 Libgdx 项目时,代码的更改没

                  相关文章

                  最新文章

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

                  1. <small id='bLSNy'></small><noframes id='bLSNy'>

                  2. <tfoot id='bLSNy'></tfoot>
                    1. <legend id='bLSNy'><style id='bLSNy'><dir id='bLSNy'><q id='bLSNy'></q></dir></style></legend>