开发者

On the fly bitmap editing in Android

开发者 https://www.devze.com 2023-01-05 23:43 出处:网络
I\'m creating a scene for a game. There\'s a background which is a bitmap and player objects. I want to have the player objects to be able to \"eat\" away at the background with a transparent color a

I'm creating a scene for a game.

There's a background which is a bitmap and player objects. I want to have the player objects to be able to "eat" away at the background with a transparent color as they move around the board. Basically if an object is at a certain point a circle around that开发者_Go百科 object is alpha'ed out of the bitmap. The edits of the bitmap need to persist.

What's the best way to accomplish this? I was thinking of modifying the pixels for the bitmap using Bitmap.setPixel but that would probably be very expensive.


I figured it out. I need to basically use Canvas's draw functions which are applied to a bitmap. IE Canvas.drawBitmap()

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号