how to flip a pixmap to draw to a texture in libgdx?(如何翻转像素图以绘制到 libgdx 中的纹理?)
问题描述
所以我要做的是通过将像素图绘制到纹理来为我的游戏生成背景图像.到目前为止,我可以做到这一点,但现在我需要将在 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:
这篇关于如何翻转像素图以绘制到 libgdx 中的纹理?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!