Android 中的即时位图编辑
我正在为游戏创建一个场景。
有一个背景,它是位图和播放器对象。我希望玩家对象在棋盘上移动时能够以透明颜色“吃掉”背景。基本上,如果一个对象位于某个点,则该对象周围的圆圈将从位图中进行 Alpha 处理。位图的编辑需要保留。
实现这一目标的最佳方法是什么?我正在考虑使用 Bitmap.setPixel 修改位图的像素,但这可能会非常昂贵。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想通了。
我基本上需要使用应用于位图的 Canvas 绘制函数。
IE
Canvas.drawBitmap()
I figured it out.
I need to basically use Canvas's draw functions which are applied to a bitmap.
IE
Canvas.drawBitmap()