LIBGDX:SpriteBatch 绘制未在 iOS 上绘制

LIBGDX: SpriteBatch draw not drawing on iOS

变量:

int sourceX = 0;

创建()方法:

texture = new Texture(Gdx.files.internal("background.jpg"));
texture.setWrap(Texture.TextureWrap.Repeat, Texture.TextureWrap.Repeat);

render() 方法:

batch.begin();
sourceX+=velocitaScorrimentoSfondo;
batch.draw(texture, 0, 0, sourceX, 0, (int) texture.getWidth(), (int) texture.getHeight());
batch.end();

我的目标是在后台自动 运行。从左到右 。 我们做到了,但是在 iOS 上,当我启动带有 RoboVM 的模拟器时,滚动不起作用,也就是说,我看不到背景。而模拟器 genymotion 和,在物理设备上 Android,整个工作。 使用演员(图像)一切正常,只有平局不行。 或者,如果有人建议我如何滑动背景 Actor,请转换背景滑动 Actor。 它可能有图形库? 我该如何解决?如果你想要其他代码,请写在评论中。

确保背景纹理为正方形,其尺寸为 2 的幂,例如 256x256、512x512 或 1024x1024。 OpenGL 2.0 兼容设备支持不遵守此规则的绘图纹理,但 TextureWrapping/Repeating 可能会出现问题。

我以前遇到过这个问题,如果您有兴趣,可以到 badlogicgames 论坛 link 讨论一下。

http://www.badlogicgames.com/forum/viewtopic.php?f=11&t=16695&p=71424#p71424