Image overlays and hot regions in android

不羁的心 提交于 2019-12-12 02:44:49

问题


I am writing an activity where there is a picture that is hidden by some other picture that is broken to active slices. You will be able to click each slice and perform some action. When this action is successfull the overlay slice disappears and a part of original image is displayed. The game finishes when you uncover complete image.

Imagine Mahjongg with the floor level. You can click a tile and if it matches another selected tile the background under the tile is displayed. My task is similar. I want to hide the picture with series of tiles that user can click.

I already started with some investigation. Interesting concept was explained a ImageMap blog. That could work but I would love to generate number of tiles dynamically - based on a display resolution and a difficulty level.

I tend to implement the logic manually using custom View with Canvas that holds uncovered tiles graphics and when I need to unhide target image slice I will get it from the target Bitmap. Seems like a lot of calculations.

Is there a better way?

来源:https://stackoverflow.com/questions/33197836/image-overlays-and-hot-regions-in-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!