Android Custom wheel or slot machine implementation

我怕爱的太早我们不能终老 提交于 2019-12-03 11:39:19

For the perspective, look at http://developer.android.com/reference/android/graphics/Camera.html

You set the location of the camera, and then get the matrix, and use it to draw the image.It will set the skew, and scale for you.

I dont know how close you are to achieving your goal but you may want to skip using android classes and use a 3d engine like cocos 3d for android. Importing a model and making it clickable in the right spots and all that kind of stuff would be abstracted for you so you dont spend time messing around with other things.

Just try this, keep 6 views 5 as shown in image and one in reserve. When the view 1 goes out of scope the reserve view came in with the next image & the view 1 became the reserve view similarly you should render the cycle as many times you want.

The width grows while it moves from bottom to center and shrinks when it rolls towards top

Breadbin

Have you seen this? You may be able to adjust it but it's a starting point at least https://code.google.com/p/android-wheel/

UPDATE: the project has moved to github

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