嗨,我正在使用 Andengine 制作游戏应用程序
因为我想在单击该精灵时更改精灵的背景图像。任何机构都可以帮助我如何做到这一点。
this.mFaceTextureRegionBackOn = TextureRegionFactory.extractFromTexture(this.mTextureBackOn);
this.mFaceTextureRegionBackOff = TextureRegionFactory.extractFromTexture(this.mTextureBackOff);
final ButtonSprite back = new ButtonSprite(centerXBack, centerYBack, this.mFaceTextureRegionBackOn, this.getVertexBufferObjectManager());
scene.attachChild(back);
back.setOnClickListener(new OnClickListener() {
@Override
public void onClick(ButtonSprite arg0, float arg1, float arg2) {
MainActivity.this.mFaceTextureRegionBackOn = TextureRegionFactory.extractFromTexture(MainActivity.this.mTextureBackOff);
}
});
当我单击该按钮时有一个精灵按钮,我正在更改它的纹理区域,但它无法帮助我更改该精灵的图像