Jeremy Edwards
Jeremy Edwards

Reputation: 14740

On the fly bitmap editing in Android

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 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.

Upvotes: 1

Views: 925

Answers (1)

Jeremy Edwards
Jeremy Edwards

Reputation: 14740

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

Upvotes: 1

Related Questions