简体   繁体   中英

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);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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