Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在我目前正在编程的游戏中,我有一个 4x3 矩阵中具有不同动画帧的平铺图像。我想AnimationDrawable按顺序创建一个由这些框架中的每一个组成的。但是,我只知道用整个图像作为帧来制作动画。有人可以帮助我如何做到这一点吗?如果这可以在 XML 中完成,那就更好了。
AnimationDrawable
谢谢!
您可以使用Bitmap.createBitmap从大位图创建剪切位图,并使用AnimationDrawable.addFrame将位图添加到 AnimationDrawable。