简体   繁体   English

如何使用rajawali切换对象的位图纹理?

[英]How to switch bitmap texture of Object by using rajawali?

I want to develop a function that there are has a object in my scene, and this object has a bitmap texture. 我想开发一个功能,该功能在我的场景中有一个对象,并且该对象具有位图纹理。 Then if you touched the object, its texture will be switched to another one, how can I implement it? 然后,如果您触摸了该对象,其纹理将被切换为另一个,我该如何实现呢?

After few days study, I find a way which can resolve my texture replacement issue, please reference the below codes: 经过几天的研究,我找到了一种可以解决我的纹理替换问题的方法,请参考以下代码:

Texture texture = getTexture(TOAST_TEXTURE_NAME);
texture.setBitmap(mToastTextTexture.textAsBitmap(toastString));
TextureManager.getInstance().replaceTexture(texture);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM