Android 如何更改安德林上的背景纹理?

Android 如何更改安德林上的背景纹理?,android,background,andengine,Android,Background,Andengine,我有一个背景纹理,并希望将其更改为其他背景纹理。我已经阅读并测试了一些关于背景纹理的示例,但是第二个背景没有显示出来 这是我尝试更改的最后一个代码…有人能帮忙吗? 谢谢 我在使用精灵改变背景时也遇到了一些问题。我终于成功地使用了SpriteBackground。只需从您的精灵创建一个: SpriteBackground background = new SpriteBackground(backgroundSprite); 不要调用attachchild,而是调用setBackground:

我有一个背景纹理,并希望将其更改为其他背景纹理。我已经阅读并测试了一些关于背景纹理的示例,但是第二个背景没有显示出来

这是我尝试更改的最后一个代码…有人能帮忙吗? 谢谢


我在使用精灵改变背景时也遇到了一些问题。我终于成功地使用了SpriteBackground。只需从您的精灵创建一个:

SpriteBackground background = new SpriteBackground(backgroundSprite);
不要调用attachchild,而是调用setBackground:

scene.setBackground(background);

只需更改加载到此区域的纹理MBackgroundTextureRegion1我已更新代码,以加载新纹理,但没有任何更改。仍然显示第一个背景。谢谢
scene.setBackground(background);