Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想开发一个功能,在我的场景中有一个对象,这个对象有一个位图纹理。那么如果你触摸了物体,它的纹理就会切换到另一个,我该如何实现呢?
经过几天的研究,我找到了一种可以解决我的纹理替换问题的方法,请参考以下代码:
Texture texture = getTexture(TOAST_TEXTURE_NAME); texture.setBitmap(mToastTextTexture.textAsBitmap(toastString)); TextureManager.getInstance().replaceTexture(texture);